persistence

package
v0.0.0-...-6531ba9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyExists       = errors.New("already exists")
	ErrNotFound            = errors.New("not found")
	ErrProviderNotVerified = errors.New("provider not verified")
	ErrInvalidConfigType   = errors.New("invalid config type")
)

Functions

This section is empty.

Types

type CreateMailingProviderArgs

type CreateMailingProviderArgs struct {
	// UID is the unique identifier of the mailing provider.
	UID string
	// Name is the name of the mailing provider.
	Name string
	// FromAddress is the default from address of the mailing provider.
	FromAddress *mail.Address
	// Type is the type of the mailing provider.
	Type mailingpb.MailingProviderType
	// Config is the configuration of the mailing provider.
	Config mailingpb.MailingProviderConfig
}

CreateMailingProviderArgs creates a new mailing provider.

type MailingProviderStorage

type MailingProviderStorage interface {
	CreateProvider(ctx context.Context, in *CreateMailingProviderArgs) (mailprovider.MailingProviderDefinition, error)
	UpdateProvider(ctx context.Context, in *UpdateMailingProviderArgs) (UpdateMailingProviderResult, error)
	SetCurrentProvider(ctx context.Context, in *SetCurrentMailingProviderArgs) error
	MarkProviderVerified(ctx context.Context, in *MarkProviderVerifiedArgs) error
	GetCurrentProvider(ctx context.Context) (mailprovider.MailingProviderDefinition, error)
	ListProviders(ctx context.Context) ([]mailprovider.MailingProviderDefinition, error)
}

MailingProviderStorage is an interface that represents a mailing provider storage.

type SetCurrentMailingProviderArgs

type SetCurrentMailingProviderArgs struct {
	// UID is the unique identifier of the mailing provider.
	UID string
}

SetCurrentMailingProviderArgs sets the current mailing provider.

type UpdateMailingProviderArgs

type UpdateMailingProviderArgs struct {
	// UID is the unique identifier of the mailing provider.
	UID string
	// Name is the name of the mailing provider.
	Name string
	// FromAddress is the default from address of the mailing provider.
	FromAddress *mail.Address
	// Config is the configuration of the mailing provider.
	Config *mailingpb.MailingProviderConfig
}

UpdateMailingProviderArgs updates a mailing provider.

type UpdateMailingProviderResult

type UpdateMailingProviderResult struct {
	WasInUse        bool
	MailingProvider mailprovider.MailingProviderDefinition
}

UpdateMailingProviderResult is the result of the UpdateMailingProvider method.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL