system

package
v0.0.0-...-86906c4 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	aggregate.Root

	SystemEmail               string
	SecurityEmail             string
	SignUpEnabled             bool
	SignUpAutoActivateEnabled bool
	TOTPRequired              bool
	TOTPSMSEnabled            bool
	GoogleSignInEnabled       bool
	GoogleSignInClientID      string
	TwilioSID                 string
	TwilioToken               string
	TwilioFromTel             string
	SetupRequired             bool
}

func (*Config) ChangeGoogleSignInClientID

func (c *Config) ChangeGoogleSignInClientID(clientID GoogleClientID)

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) DisableGoogleSignIn

func (c *Config) DisableGoogleSignIn()

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) EnableGoogleSignIn

func (c *Config) EnableGoogleSignIn() error

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 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 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,
	googleSignInEnabled bool, googleSignInClientID string,
	twilioSID, twilioToken, twilioFromTel string,
) (*Config, 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 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