system

package
v0.0.0-...-1f8de80 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestRepo

func TestRepo(ctx context.Context, t *testing.T, newRepo func() ReadWriter)

Types

type Config

type Config struct {
	aggregate.Root

	SystemEmail               string
	SecurityEmail             string
	SignUpEnabled             bool
	SignUpAutoActivateEnabled bool
	TOTPRequired              bool
	TOTPSMSEnabled            bool
	MagicLinkSignInEnabled    bool
	GoogleSignInEnabled       bool
	GoogleSignInClientID      string
	FacebookSignInEnabled     bool
	FacebookSignInAppID       string
	FacebookSignInAppSecret   string
	ResendAPIKey              string
	TwilioSID                 string
	TwilioToken               string
	TwilioFromTel             string
	SetupRequired             bool
}

func (*Config) ChangeFacebookSignInAppID

func (c *Config) ChangeFacebookSignInAppID(appID FacebookAppID)

func (*Config) ChangeFacebookSignInAppSecret

func (c *Config) ChangeFacebookSignInAppSecret(appSecret FacebookAppSecret)

func (*Config) ChangeGoogleSignInClientID

func (c *Config) ChangeGoogleSignInClientID(clientID GoogleClientID)

func (*Config) ChangeResendAPI

func (c *Config) ChangeResendAPI(apiKey ResendAPIKey)

func (*Config) ChangeSecurityEmail

func (c *Config) ChangeSecurityEmail(securityEmail Email)

func (*Config) ChangeSystemEmail

func (c *Config) ChangeSystemEmail(systemEmail Email)

func (*Config) ChangeTwilioAPI

func (c *Config) ChangeTwilioAPI(twilioSID TwilioSID, twilioToken TwilioToken, twilioFromTel TwilioTel)

func (*Config) DisableFacebookSignIn

func (c *Config) DisableFacebookSignIn()

func (*Config) DisableGoogleSignIn

func (c *Config) DisableGoogleSignIn()

func (*Config) DisableMagicLinkSignIn

func (c *Config) DisableMagicLinkSignIn()

func (*Config) DisableSignUp

func (c *Config) DisableSignUp()

func (*Config) DisableSignUpAutoActivate

func (c *Config) DisableSignUpAutoActivate()

func (*Config) DisableTOTPRequired

func (c *Config) DisableTOTPRequired()

func (*Config) DisableTOTPSMS

func (c *Config) DisableTOTPSMS()

func (*Config) EnableFacebookSignIn

func (c *Config) EnableFacebookSignIn() error

func (*Config) EnableGoogleSignIn

func (c *Config) EnableGoogleSignIn() error

func (*Config) EnableMagicLinkSignIn

func (c *Config) EnableMagicLinkSignIn()

func (*Config) EnableSignUp

func (c *Config) EnableSignUp()

func (*Config) EnableSignUpAutoActivate

func (c *Config) EnableSignUpAutoActivate()

func (*Config) EnableTOTPRequired

func (c *Config) EnableTOTPRequired()

func (*Config) EnableTOTPSMS

func (c *Config) EnableTOTPSMS() error

func (*Config) HasSMS

func (c *Config) HasSMS() bool

type Email

type Email string

func NewEmail

func NewEmail(email string) (Email, error)

func (Email) String

func (e Email) String() string

type FacebookAppID

type FacebookAppID string

func NewFacebookAppID

func NewFacebookAppID(id string) (FacebookAppID, error)

func (FacebookAppID) String

func (e FacebookAppID) String() string

type FacebookAppSecret

type FacebookAppSecret string

func NewFacebookAppSecret

func NewFacebookAppSecret(secret string) (FacebookAppSecret, error)

func (FacebookAppSecret) String

func (e FacebookAppSecret) String() string

type GoogleClientID

type GoogleClientID string

func NewGoogleClientID

func NewGoogleClientID(id string) (GoogleClientID, error)

func (GoogleClientID) String

func (e GoogleClientID) String() string

type ReadWriter

type ReadWriter interface {
	Reader
	Writer
}

type Reader

type Reader interface {
	FindConfig(ctx context.Context) (*Config, error)
}

type ResendAPIKey

type ResendAPIKey string

func NewResendAPIKey

func NewResendAPIKey(apiKey string) (ResendAPIKey, error)

func (ResendAPIKey) String

func (e ResendAPIKey) String() string

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(broker event.Broker, repo ReadWriter) (*Service, error)

func (*Service) UpdateConfig

func (s *Service) UpdateConfig(ctx context.Context, guard UpdateConfigGuard,
	systemEmail, securityEmail string,
	signUpEnabled, signUpAutoActivateEnabled bool,
	totpRequired, totpSMSEnabled bool,
	magicLinkSignInEnabled bool,
	googleSignInEnabled bool, googleSignInClientID string,
	facebookSignInEnabled bool, facebookSignInAppID, facebookSignInAppSecret string,
	resendAPIKey string,
	twilioSID, twilioToken, twilioFromTel string,
) error

func (*Service) UpdateEmails

func (s *Service) UpdateEmails(ctx context.Context, guard UpdateEmailsGuard, systemEmail, securityEmail string) error

type TwilioSID

type TwilioSID string

func NewTwilioSID

func NewTwilioSID(sid string) (TwilioSID, error)

func (TwilioSID) String

func (e TwilioSID) String() string

type TwilioTel

type TwilioTel string

func NewTwilioTel

func NewTwilioTel(tel string) (TwilioTel, error)

func (TwilioTel) String

func (t TwilioTel) String() string

type TwilioToken

type TwilioToken string

func NewTwilioToken

func NewTwilioToken(token string) (TwilioToken, error)

func (TwilioToken) String

func (e TwilioToken) String() string

type UpdateConfigGuard

type UpdateConfigGuard interface {
	CanUpdateConfig() bool
}

type UpdateEmailsGuard

type UpdateEmailsGuard interface {
	CanUpdateEmails() bool
}

type Writer

type Writer interface {
	SaveConfig(ctx context.Context, config *Config) error
}

Jump to

Keyboard shortcuts

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