di

package
v0.0.0-...-185ace6 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Options(
	configfx,
	validatorfx,
	hasherfx,
	debugfx,
	serverfx,
	databasefx,
	account.Module,
	refreshtoken.Module,
	user.Module,
	jwtfx,
	apifx,
)

Functions

func NewDebug

func NewDebug(p DebugParams) error

func NewFxLogger

func NewFxLogger(log ...logger.Logger) fx.Printer

func NewServer

func NewServer(p ServerParams) (*http.Server, error)

func ProvideAPIConfig

func ProvideAPIConfig(config *config.Config) *config.APIConfig

func ProvideAPIJWTConfig

func ProvideAPIJWTConfig(config *config.APIConfig) *config.JWTConfig

func ProvideDatabaseConfig

func ProvideDatabaseConfig(config *config.Config) *config.DatabaseConfig

func ProvideDebugConfig

func ProvideDebugConfig(config *config.Config) *config.DebugConfig

func ProvideHTTPConfig

func ProvideHTTPConfig(config *config.Config) *config.HTTPConfig

func ProvideHasher

func ProvideHasher(config *hash.HasherArgon2Config) hash.Hasher

func ProvideHasherArgon2Config

func ProvideHasherArgon2Config(config *config.HashersConfig) *hash.HasherArgon2Config

func ProvideHashersConfig

func ProvideHashersConfig(config *config.Config) *config.HashersConfig

func ProvideJWTService

func ProvideJWTService(config *config.JWTConfig) (jwt.Service, error)

func ProvideLevelDBDatabase

func ProvideLevelDBDatabase(config *database_leveldb.Config) (*leveldb.DB, error)

func ProvideLoggerConfig

func ProvideLoggerConfig(config *config.Config) *logger.Config

func ProvideValidator

func ProvideValidator() *validator.Validate

Types

type APIHandlerParams

type APIHandlerParams struct {
	fx.In

	Lifecycle fx.Lifecycle

	Log    logger.Logger
	Config *config.Config

	JWTService          jwt.Service
	AccountUsecase      account.AccountUsecase
	RefreshTokenUsecase refreshtoken.RefreshTokenUsecase
	UserUsecase         user.UserUsecase
}

type APIHandlerResult

type APIHandlerResult struct {
	fx.Out

	Router http.Handler `name:"api"`
}

func APIHandlerProvider

func APIHandlerProvider(p APIHandlerParams) (APIHandlerResult, error)

type DatabaseConfigResult

type DatabaseConfigResult struct {
	fx.Out

	Type              string `name:"db_type"`
	JSONMutexDBConfig *database_jsonmutexdb.Config
	LevelDBConfig     *database_leveldb.Config
}

func ProvideDatabaseConfigResult

func ProvideDatabaseConfigResult(config *config.DatabaseConfig) DatabaseConfigResult

type DatabaseParams

type DatabaseParams struct {
	fx.In

	Type string `name:"db_type"`

	JSONMutexDBConfig *database_jsonmutexdb.Config
	LevelDBConfig     *database_leveldb.Config
}

type DatabaseResult

type DatabaseResult struct {
	fx.Out

	JSONLoadSaver *database_jsonmutexdb.LoadSaver `optional:"true"`
	LevelDB       *leveldb.DB                     `optional:"true"`
}

func ProvideDatabase

func ProvideDatabase(p DatabaseParams) (DatabaseResult, error)

type DebugParams

type DebugParams struct {
	fx.In

	Lifecycle fx.Lifecycle
	OnErrorCh chan error

	Log         logger.Logger
	DebugConfig *config.DebugConfig
}

type ServerParams

type ServerParams struct {
	fx.In

	Lifecycle fx.Lifecycle
	OnErrorCh chan error

	Log        logger.Logger
	HTTPConfig *config.HTTPConfig
	Router     http.Handler `name:"api"`
}

Jump to

Keyboard shortcuts

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