config

package
v0.0.0-...-c662a9e Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 9 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 interface {
	Setting() Setting

	Clock() clockwork.Clock
	DB() *sql.DB
	PasswordHasher() crypto.Hasher
	SmsV1Client() smsv1.SmsServiceClient
	UserTokenService() service.UserTokenService
}

type DefaultConfig

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

func New

func New(
	setting Setting,
	clock clockwork.Clock,
	db *sql.DB,
	passwordHasher crypto.Hasher,
	smsv1Cli smsv1.SmsServiceClient,
	userTokenService service.UserTokenService,
) *DefaultConfig

func (*DefaultConfig) Clock

func (c *DefaultConfig) Clock() clockwork.Clock

func (*DefaultConfig) DB

func (c *DefaultConfig) DB() *sql.DB

func (*DefaultConfig) PasswordHasher

func (c *DefaultConfig) PasswordHasher() crypto.Hasher

func (*DefaultConfig) Setting

func (c *DefaultConfig) Setting() Setting

func (*DefaultConfig) SmsV1Client

func (c *DefaultConfig) SmsV1Client() smsv1.SmsServiceClient

func (*DefaultConfig) UserTokenService

func (c *DefaultConfig) UserTokenService() service.UserTokenService

type Setting

type Setting struct {
	GRPCServerPort            int
	HTTPServerPort            int
	GracefulShutdownTimeoutMs int

	DB mysql.Setting

	AccessTokenExpiresInMs  int
	RefreshTokenExpiresInMs int

	SMSOTPCodeLength int

	SMSV1ServiceEndpoint string
}

func NewSetting

func NewSetting() Setting

Jump to

Keyboard shortcuts

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