Documentation
¶
Index ¶
- Constants
- Variables
- func Connect() (*sql.DB, error)
- func Exec(db sq.BaseRunner, q sq.Sqlizer, expectAffectedRows int64) error
- func PostfixCanonicalMaps(r sq.BaseRunner, email utils.EmailAddress) (string, error)
- func PostfixRelayDomains(r sq.BaseRunner, fqdn string) (string, error)
- func PostfixRelayRecipientMaps(r sq.BaseRunner, email utils.EmailAddress) (string, error)
- func PostfixSMTPDSenderLoginMapsMailboxes(r sq.BaseRunner, email utils.EmailAddress, limit uint32) ([]string, error)
- func PostfixSMTPDSenderLoginMapsRemotes(r sq.BaseRunner, email utils.EmailAddress) ([]string, error)
- func PostfixTransportMaps(r sq.BaseRunner, email utils.EmailAddress) (string, error)
- func PostfixVirtualAliasDomains(r sq.BaseRunner, fqdn string) (string, error)
- func PostfixVirtualAliasMaps(r sq.BaseRunner, email utils.EmailAddress, limit uint32) ([]string, error)
- func PostfixVirtualMailboxDomains(r sq.BaseRunner, fqdn string) (string, error)
- func PostfixVirtualMailboxMaps(r sq.BaseRunner, email utils.EmailAddress) (string, error)
- type Alias
- type AliasTarget
- type AliasesCreateOptions
- type AliasesListOptions
- type AliasesPatchOptions
- type AliasesRepository
- type AliasesTargetsCreateOptions
- type AliasesTargetsListOptions
- type AliasesTargetsPatchOptions
- type AliasesTargetsRepository
- type Config
- type DeleteOptions
- type Domain
- type DomainCatchallTarget
- type DomainsCatchallTargetsCreateOptions
- type DomainsCatchallTargetsListOptions
- type DomainsCatchallTargetsPatchOptions
- type DomainsCatchallTargetsRepository
- type DomainsCreateOptions
- type DomainsListOptions
- type DomainsPatchOptions
- type DomainsRepository
- type Mailbox
- type MailboxLoginAttempt
- type MailboxesCreateOptions
- type MailboxesListOptions
- type MailboxesLoginAttemptsListOptions
- type MailboxesLoginAttemptsRepository
- type MailboxesPatchOptions
- type MailboxesRepository
- type RecipientRelayed
- type RecipientsRelayedCreateOptions
- type RecipientsRelayedListOptions
- type RecipientsRelayedPatchOptions
- type RecipientsRelayedRepository
- type Remote
- type RemoteSendGrant
- type RemotesCreateOptions
- type RemotesListOptions
- type RemotesPatchOptions
- type RemotesRepository
- type RemotesSendGrantsCreateOptions
- type RemotesSendGrantsListOptions
- type RemotesSendGrantsRepository
- type Transport
- type TransportsCreateOptions
- type TransportsListOptions
- type TransportsPatchOptions
- type TransportsRepository
- type TxExecForEach
- type TxExecFunc
- type TxForEachRunner
- type TxRunner
Constants ¶
View Source
const (
MailboxesLoginAttemptsTable string = "audit.mailboxes_login_attempts"
)
Variables ¶
View Source
var (
ErrAffectedRowsMismatch = errors.New("affected rows do not match expectation")
)
Functions ¶
func PostfixCanonicalMaps ¶
func PostfixCanonicalMaps(r sq.BaseRunner, email utils.EmailAddress) (string, error)
func PostfixRelayDomains ¶
func PostfixRelayDomains(r sq.BaseRunner, fqdn string) (string, error)
func PostfixRelayRecipientMaps ¶
func PostfixRelayRecipientMaps(r sq.BaseRunner, email utils.EmailAddress) (string, error)
func PostfixSMTPDSenderLoginMapsMailboxes ¶
func PostfixSMTPDSenderLoginMapsMailboxes(r sq.BaseRunner, email utils.EmailAddress, limit uint32) ([]string, error)
func PostfixSMTPDSenderLoginMapsRemotes ¶
func PostfixSMTPDSenderLoginMapsRemotes(r sq.BaseRunner, email utils.EmailAddress) ([]string, error)
func PostfixTransportMaps ¶
func PostfixTransportMaps(r sq.BaseRunner, email utils.EmailAddress) (string, error)
func PostfixVirtualAliasDomains ¶
func PostfixVirtualAliasDomains(r sq.BaseRunner, fqdn string) (string, error)
func PostfixVirtualAliasMaps ¶
func PostfixVirtualAliasMaps(r sq.BaseRunner, email utils.EmailAddress, limit uint32) ([]string, error)
func PostfixVirtualMailboxDomains ¶
func PostfixVirtualMailboxDomains(r sq.BaseRunner, fqdn string) (string, error)
func PostfixVirtualMailboxMaps ¶
func PostfixVirtualMailboxMaps(r sq.BaseRunner, email utils.EmailAddress) (string, error)
Types ¶
type Alias ¶
type Alias struct {
DomainFQDN string `json:"domainFQDN"`
DomainEnabled bool `json:"domainEnabled"`
Name *string `json:"name"`
Enabled bool `json:"enabled"`
TargetCount int `json:"targetCount"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt *time.Time `json:"deletedAt,omitempty"`
}
type AliasTarget ¶
type AliasTarget struct {
AliasEmail string `json:"aliasEmail"`
TargetEmail string `json:"targetEmail"`
IsForeign bool `json:"isForeign"`
ForwardingToTargetEnabled bool `json:"forwardingEnabled"`
SendingFromTargetEnabled bool `json:"sendingEnabled"` // Only for recursive
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt *time.Time `json:"deletedAt,omitempty"`
AliasEnabled bool `json:"-"`
DomainEnabled *bool `json:"-"`
}
type AliasesCreateOptions ¶
type AliasesCreateOptions struct {
Disabled bool
}
type AliasesListOptions ¶
type AliasesPatchOptions ¶
type AliasesPatchOptions struct {
Enabled *bool
}
type AliasesRepository ¶
type AliasesRepository interface {
List(options AliasesListOptions) ([]Alias, error)
Create(email utils.EmailAddress, options AliasesCreateOptions) error
Patch(email utils.EmailAddress, options AliasesPatchOptions) error
Rename(oldEmail utils.EmailAddress, newEmail utils.EmailAddress) error
Delete(email utils.EmailAddress, options DeleteOptions) error
Restore(email utils.EmailAddress) error
}
func Aliases ¶
func Aliases(r sq.BaseRunner) AliasesRepository
type AliasesTargetsListOptions ¶
type AliasesTargetsListOptions struct {
FilterAliasEmails []utils.EmailAddress
IncludeDeleted bool
IncludeAll bool
}
type AliasesTargetsRepository ¶
type AliasesTargetsRepository interface {
List(options AliasesTargetsListOptions) ([]AliasTarget, error)
Create(aliasEmail utils.EmailAddress, targetEmail utils.EmailAddress, options AliasesTargetsCreateOptions) error
Patch(aliasEmail utils.EmailAddress, targetEmail utils.EmailAddress, options AliasesTargetsPatchOptions) error
Delete(aliasEmail utils.EmailAddress, targetEmail utils.EmailAddress, options DeleteOptions) error
Restore(aliasEmail utils.EmailAddress, targetEmail utils.EmailAddress) error
}
func AliasesTargets ¶
func AliasesTargets(r sq.BaseRunner) AliasesTargetsRepository
type Config ¶
type DeleteOptions ¶
type Domain ¶
type Domain struct {
FQDN string `json:"fqdn"`
Type string `json:"type"`
Enabled bool `json:"enabled"`
Transport *string `json:"transport,omitempty"`
TransportName *string `json:"transportName,omitempty"`
TargetDomainFQDN *string `json:"targetDomainFQDN,omitempty"`
TargetDomainEnabled bool `json:"targetDomainEnabled"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt *time.Time `json:"deletedAt,omitempty"`
}
type DomainCatchallTarget ¶
type DomainCatchallTarget struct {
DomainFQDN string `json:"domain"`
TargetEmail string `json:"targetEmail"`
ForwardingToTargetEnabled bool `json:"forwardingEnabled"`
FallbackOnly bool `json:"fallbackOnly"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt *time.Time `json:"deletedAt,omitempty"`
DomainEnabled bool `json:"-"`
}
type DomainsCatchallTargetsRepository ¶
type DomainsCatchallTargetsRepository interface {
List(options DomainsCatchallTargetsListOptions) ([]DomainCatchallTarget, error)
Create(srcDomainFQDN string, targetEmail utils.EmailAddress, options DomainsCatchallTargetsCreateOptions) error
Patch(srcDomainFQDN string, targetEmail utils.EmailAddress, options DomainsCatchallTargetsPatchOptions) error
Delete(srcDomainFQDN string, targetEmail utils.EmailAddress, options DeleteOptions) error
Restore(srcDomainFQDN string, targetEmail utils.EmailAddress) error
}
func DomainsCatchallTargets ¶
func DomainsCatchallTargets(r sq.BaseRunner) DomainsCatchallTargetsRepository
type DomainsCreateOptions ¶
type DomainsListOptions ¶
type DomainsPatchOptions ¶
type DomainsRepository ¶
type DomainsRepository interface {
List(options DomainsListOptions) ([]Domain, error)
Create(fqdn string, options DomainsCreateOptions) error
Patch(fqdn string, options DomainsPatchOptions) error
Rename(oldFQDN, newFQDN string) error
Delete(fqdn string, options DeleteOptions) error
Restore(fqdn string) error
}
func Domains ¶
func Domains(r sq.BaseRunner) DomainsRepository
type Mailbox ¶
type Mailbox struct {
DomainFQDN string `json:"domainFQDN"`
DomainEnabled bool `json:"domainEnabled"`
Name string `json:"name"`
LoginEnabled bool `json:"loginEnabled"`
ReceivingEnabled bool `json:"receivingEnabled"`
SendingEnabled bool `json:"sendingEnabled"`
PasswordSet bool `json:"passwordHashSet"`
StorageQuota *int32 `json:"storageQuota,omitempty"`
Transport *string `json:"transport,omitempty"`
TransportName *string `json:"transportName,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt *time.Time `json:"deletedAt,omitempty"`
}
type MailboxLoginAttempt ¶
type MailboxesCreateOptions ¶
type MailboxesCreateOptions struct {
PasswordHash sql.NullString
Quota sql.NullInt32
TransportName sql.NullString
LoginEnabled bool
ReceivingEnabled bool
SendingEnabled bool
}
type MailboxesListOptions ¶
type MailboxesListOptions struct {
FilterDomains []string
ByEmail *utils.EmailAddress
IncludeDeleted bool
IncludeAll bool
}
type MailboxesLoginAttemptsListOptions ¶
type MailboxesLoginAttemptsListOptions struct {
FilterDomains []string
FilterEmails []*utils.EmailAddress
}
type MailboxesLoginAttemptsRepository ¶
type MailboxesLoginAttemptsRepository interface {
List(options MailboxesLoginAttemptsListOptions) ([]MailboxLoginAttempt, error)
CheckRateLimit(email utils.EmailAddress, count uint32, interval time.Duration) (ok bool, err error)
Record(email utils.EmailAddress, succeeded bool, failureReason string) (err error)
}
func MailboxesLoginAttempts ¶
func MailboxesLoginAttempts(r sq.BaseRunner) MailboxesLoginAttemptsRepository
type MailboxesPatchOptions ¶
type MailboxesPatchOptions struct {
PasswordHash *sql.NullString
Quota *sql.NullInt32
TransportName *sql.NullString
Login *bool
Receiving *bool
Sending *bool
}
type MailboxesRepository ¶
type MailboxesRepository interface {
List(options MailboxesListOptions) ([]Mailbox, error)
Authenticate(email utils.EmailAddress, givenPassword string) (matches bool, err error)
Create(address utils.EmailAddress, options MailboxesCreateOptions) error
Patch(email utils.EmailAddress, options MailboxesPatchOptions) error
Rename(oldEmail utils.EmailAddress, newEmail utils.EmailAddress) error
Delete(email utils.EmailAddress, options DeleteOptions) error
Restore(email utils.EmailAddress) error
}
func Mailboxes ¶
func Mailboxes(r sq.BaseRunner) MailboxesRepository
type RecipientRelayed ¶
type RecipientsRelayedCreateOptions ¶
type RecipientsRelayedCreateOptions struct {
Enabled bool
}
type RecipientsRelayedListOptions ¶
type RecipientsRelayedListOptions struct {
FilterDomains []string
ByEmail *utils.EmailAddress
IncludeDeleted bool
IncludeAll bool
}
type RecipientsRelayedPatchOptions ¶
type RecipientsRelayedPatchOptions struct {
Enabled *bool
}
type RecipientsRelayedRepository ¶
type RecipientsRelayedRepository interface {
List(options RecipientsRelayedListOptions) ([]RecipientRelayed, error)
Create(email utils.EmailAddress, options RecipientsRelayedCreateOptions) error
Patch(email utils.EmailAddress, options RecipientsRelayedPatchOptions) error
Rename(oldEmail, newEmail utils.EmailAddress) error
Delete(email utils.EmailAddress, options DeleteOptions) error
Restore(email utils.EmailAddress) error
}
func RecipientsRelayed ¶
func RecipientsRelayed(r sq.BaseRunner) RecipientsRelayedRepository
type RemoteSendGrant ¶
type RemoteSendGrant struct {
ID int `json:"-"`
RemoteID int `json:"-"`
RemoteName string `json:"remote_name"`
DomainID int `json:"-"`
DomainFQDN string `json:"domain_fqdn"`
DomainEnabled bool `json:"domain_enabled"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
type RemotesCreateOptions ¶
type RemotesCreateOptions struct {
PasswordHash sql.NullString
Enabled bool
}
type RemotesListOptions ¶
type RemotesPatchOptions ¶
type RemotesPatchOptions struct {
PasswordHash *sql.NullString
Enabled *bool
}
type RemotesRepository ¶
type RemotesRepository interface {
List(options RemotesListOptions) ([]Remote, error)
Create(name string, options RemotesCreateOptions) error
Patch(name string, options RemotesPatchOptions) error
Rename(oldName, newName string) error
Delete(name string, options DeleteOptions) error
Restore(name string) error
}
func Remotes ¶
func Remotes(r sq.BaseRunner) RemotesRepository
type RemotesSendGrantsCreateOptions ¶
type RemotesSendGrantsCreateOptions struct {
}
type RemotesSendGrantsListOptions ¶
type RemotesSendGrantsListOptions struct {
FilterRemoteNames []string
MatchEmail *utils.EmailAddressOrWildcard
IncludeDeleted bool
IncludeAll bool
}
type RemotesSendGrantsRepository ¶
type RemotesSendGrantsRepository interface {
List(options RemotesSendGrantsListOptions) ([]RemoteSendGrant, error)
Create(remoteName string, email utils.EmailAddressOrWildcard, options RemotesSendGrantsCreateOptions) error
Delete(remoteName string, email utils.EmailAddressOrWildcard, options DeleteOptions) error
Restore(remoteName string, email utils.EmailAddressOrWildcard) error
}
func RemotesSendGrants ¶
func RemotesSendGrants(r sq.BaseRunner) RemotesSendGrantsRepository
type Transport ¶
type Transport struct {
Name string `json:"name"`
Method string `json:"method"`
Host string `json:"host"`
Port *uint16 `json:"port,omitempty"`
MXLookup bool `json:"mx_lookup"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
type TransportsCreateOptions ¶
type TransportsListOptions ¶
type TransportsPatchOptions ¶
type TransportsRepository ¶
type TransportsRepository interface {
List(options TransportsListOptions) ([]Transport, error)
Create(name string, options TransportsCreateOptions) error
Patch(name string, options TransportsPatchOptions) error
Rename(oldName, newName string) error
Delete(name string, options DeleteOptions) error
Restore(name string) error
}
func Transports ¶
func Transports(r sq.BaseRunner) TransportsRepository
type TxExecFunc ¶
type TxForEachRunner ¶
type TxForEachRunner[T any] struct { Items []T Exec TxExecForEach[T] ItemString func(item T) string FailureMessage string SuccessMessage string }
func (TxForEachRunner[T]) Run ¶
func (r TxForEachRunner[T]) Run()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.