2023-08-04 13:34:18 +02:00
|
|
|
package mail
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"io"
|
2025-02-28 08:29:40 +01:00
|
|
|
|
|
|
|
"github.com/h44z/wg-portal/internal/domain"
|
2023-08-04 13:34:18 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type Mailer interface {
|
|
|
|
Send(ctx context.Context, subject, body string, to []string, options *domain.MailOptions) error
|
|
|
|
}
|
|
|
|
|
|
|
|
type ConfigFileManager interface {
|
|
|
|
GetInterfaceConfig(ctx context.Context, id domain.InterfaceIdentifier) (io.Reader, error)
|
|
|
|
GetPeerConfig(ctx context.Context, id domain.PeerIdentifier) (io.Reader, error)
|
|
|
|
GetPeerConfigQrCode(ctx context.Context, id domain.PeerIdentifier) (io.Reader, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type UserDatabaseRepo interface {
|
|
|
|
GetUser(ctx context.Context, id domain.UserIdentifier) (*domain.User, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type WireguardDatabaseRepo interface {
|
|
|
|
GetInterfaceAndPeers(ctx context.Context, id domain.InterfaceIdentifier) (*domain.Interface, []domain.Peer, error)
|
|
|
|
GetPeer(ctx context.Context, id domain.PeerIdentifier) (*domain.Peer, error)
|
|
|
|
GetInterface(ctx context.Context, id domain.InterfaceIdentifier) (*domain.Interface, error)
|
|
|
|
}
|