Documentation ¶
Index ¶
- func New() *serviceManager
- type Database
- type DatabaseTransaction
- type Environment
- type Events
- type Generic
- type HttpServer
- type Logger
- type NoopDatabase
- func (n *NoopDatabase) CloseTransaction(_ context.Context, err error) error
- func (n *NoopDatabase) Get(_ context.Context, _ string, _ ...interface{}) (*sql.Rows, error)
- func (n *NoopDatabase) Insert(_ context.Context, _ string, _ ...interface{}) (sql.Result, error)
- func (n *NoopDatabase) OpenTransactionMaster(ctx context.Context) (context.Context, error)
- func (n *NoopDatabase) OpenTransactionReplica(ctx context.Context) (context.Context, error)
- func (n *NoopDatabase) Ping(_ context.Context) error
- func (n *NoopDatabase) TransactionMaster(context.Context, func(tx DatabaseTransaction) error) error
- func (n *NoopDatabase) TransactionReplica(context.Context, func(tx DatabaseTransaction) error) error
- func (n *NoopDatabase) Update(_ context.Context, _ string, _ ...interface{}) (sql.Result, error)
- func (n *NoopDatabase) WithMasterClient(_ *sql.DB) Database
- func (n *NoopDatabase) WithReplicaClient(_ *sql.DB) Database
- func (n *NoopDatabase) WithServiceManager(_ ServiceManager) Database
- func (n *NoopDatabase) WithUserDatabase() Database
- type NoopEnvironment
- func (n *NoopEnvironment) AwsAccessKey() string
- func (n *NoopEnvironment) AwsEndpoint() string
- func (n *NoopEnvironment) AwsRegion() string
- func (n *NoopEnvironment) AwsSecretKey() string
- func (n *NoopEnvironment) Configs() map[string]interface{}
- func (n *NoopEnvironment) DebugPprof() bool
- func (n *NoopEnvironment) Env() string
- func (n *NoopEnvironment) LockerConfigDynamoTable() string
- func (n *NoopEnvironment) Service() string
- func (n *NoopEnvironment) SpanUrl() string
- func (n *NoopEnvironment) UserDatabaseDsn() string
- func (n *NoopEnvironment) UserReplicaDatabaseDsn() string
- func (n *NoopEnvironment) UserTopicAddress() string
- func (n *NoopEnvironment) Version() string
- func (n *NoopEnvironment) WithServiceManager(_ ServiceManager) Environment
- type NoopEvents
- type NoopHealth
- type NoopHttpServer
- type NoopLogger
- func (n *NoopLogger) Error(_ context.Context, _ string, _ ...map[string]interface{})
- func (n *NoopLogger) Fatal(_ context.Context, _ string, _ ...map[string]interface{})
- func (n *NoopLogger) Info(_ context.Context, _ string, _ ...map[string]interface{})
- func (n *NoopLogger) Warn(_ context.Context, _ string, _ ...map[string]interface{})
- func (n *NoopLogger) WithCallerCount(_ int) Logger
- func (n *NoopLogger) WithServiceManager(_ ServiceManager) Logger
- type NoopServiceManager
- type NoopSpans
- type NoopUsersHandler
- func (n *NoopUsersHandler) Create(_ context.Context, _ domains.UserCreate) (*domains.User, error)
- func (n *NoopUsersHandler) Delete(_ context.Context, _ string) (*domains.User, error)
- func (n *NoopUsersHandler) Get(_ context.Context, _ string) (*domains.User, error)
- func (n *NoopUsersHandler) List(_ context.Context) ([]domains.User, error)
- func (n *NoopUsersHandler) Update(_ context.Context, _ domains.UserUpdate) (*domains.User, error)
- func (n *NoopUsersHandler) WithServiceManager(_ ServiceManager) UsersHandler
- type NoopUsersRepository
- func (n *NoopUsersRepository) Create(_ context.Context, _ *domains.User) error
- func (n *NoopUsersRepository) Delete(_ context.Context, _ *domains.User) error
- func (n *NoopUsersRepository) Migrate(_ context.Context) error
- func (n *NoopUsersRepository) Search(_ context.Context, _ domains.UserSearch) ([]domains.User, error)
- func (n *NoopUsersRepository) Update(_ context.Context, _ *domains.User) error
- func (n *NoopUsersRepository) WithServiceManager(_ ServiceManager) UsersRepository
- type NoopValidator
- type ServiceManager
- type Spans
- type UsersHandler
- type UsersRepository
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Database ¶
type Database interface { Generic WithServiceManager(c ServiceManager) Database WithUserDatabase() Database WithMasterClient(*sql.DB) Database WithReplicaClient(*sql.DB) Database OpenTransactionMaster(ctx context.Context) (context.Context, error) TransactionMaster(ctx context.Context, f func(tx DatabaseTransaction) error) error OpenTransactionReplica(ctx context.Context) (context.Context, error) TransactionReplica(ctx context.Context, f func(tx DatabaseTransaction) error) error CloseTransaction(ctx context.Context, err error) error }
type DatabaseTransaction ¶
type Environment ¶
type Environment interface { Generic WithServiceManager(c ServiceManager) Environment Env() string Service() string Version() string DebugPprof() bool AwsRegion() string AwsEndpoint() string AwsAccessKey() string AwsSecretKey() string SpanUrl() string UserDatabaseDsn() string UserReplicaDatabaseDsn() string UserTopicAddress() string Configs() map[string]interface{} }
type Events ¶
type Events interface { Generic WithServiceManager(c ServiceManager) Events Send(ctx context.Context, req domains.EventRequest) error SendBulk(ctx context.Context, req []domains.EventRequest) error }
type HttpServer ¶
type HttpServer interface { Generic WithServiceManager(c ServiceManager) HttpServer Run() error }
type Logger ¶
type Logger interface { Generic WithServiceManager(c ServiceManager) Logger WithCallerCount(c int) Logger Info(ctx context.Context, message string, fields ...map[string]interface{}) Warn(ctx context.Context, message string, fields ...map[string]interface{}) Error(ctx context.Context, message string, fields ...map[string]interface{}) Fatal(ctx context.Context, message string, fields ...map[string]interface{}) }
type NoopDatabase ¶
type NoopDatabase struct { NoopHealth NoopServiceManager }
func NewNoopDatabase ¶
func NewNoopDatabase() *NoopDatabase
func (*NoopDatabase) CloseTransaction ¶
func (n *NoopDatabase) CloseTransaction(_ context.Context, err error) error
func (*NoopDatabase) OpenTransactionMaster ¶
func (*NoopDatabase) OpenTransactionReplica ¶
func (*NoopDatabase) TransactionMaster ¶
func (n *NoopDatabase) TransactionMaster(context.Context, func(tx DatabaseTransaction) error) error
func (*NoopDatabase) TransactionReplica ¶
func (n *NoopDatabase) TransactionReplica(context.Context, func(tx DatabaseTransaction) error) error
func (*NoopDatabase) WithMasterClient ¶
func (n *NoopDatabase) WithMasterClient(_ *sql.DB) Database
func (*NoopDatabase) WithReplicaClient ¶
func (n *NoopDatabase) WithReplicaClient(_ *sql.DB) Database
func (*NoopDatabase) WithServiceManager ¶
func (n *NoopDatabase) WithServiceManager(_ ServiceManager) Database
func (*NoopDatabase) WithUserDatabase ¶
func (n *NoopDatabase) WithUserDatabase() Database
type NoopEnvironment ¶
type NoopEnvironment struct { NoopHealth NoopServiceManager }
func NewNoopEnvironment ¶
func NewNoopEnvironment() *NoopEnvironment
func (*NoopEnvironment) AwsAccessKey ¶
func (n *NoopEnvironment) AwsAccessKey() string
func (*NoopEnvironment) AwsEndpoint ¶
func (n *NoopEnvironment) AwsEndpoint() string
func (*NoopEnvironment) AwsRegion ¶
func (n *NoopEnvironment) AwsRegion() string
func (*NoopEnvironment) AwsSecretKey ¶
func (n *NoopEnvironment) AwsSecretKey() string
func (*NoopEnvironment) Configs ¶
func (n *NoopEnvironment) Configs() map[string]interface{}
func (*NoopEnvironment) DebugPprof ¶
func (n *NoopEnvironment) DebugPprof() bool
func (*NoopEnvironment) Env ¶
func (n *NoopEnvironment) Env() string
func (*NoopEnvironment) LockerConfigDynamoTable ¶
func (n *NoopEnvironment) LockerConfigDynamoTable() string
func (*NoopEnvironment) Service ¶
func (n *NoopEnvironment) Service() string
func (*NoopEnvironment) SpanUrl ¶
func (n *NoopEnvironment) SpanUrl() string
func (*NoopEnvironment) UserDatabaseDsn ¶
func (n *NoopEnvironment) UserDatabaseDsn() string
func (*NoopEnvironment) UserReplicaDatabaseDsn ¶
func (n *NoopEnvironment) UserReplicaDatabaseDsn() string
func (*NoopEnvironment) UserTopicAddress ¶
func (n *NoopEnvironment) UserTopicAddress() string
func (*NoopEnvironment) Version ¶
func (n *NoopEnvironment) Version() string
func (*NoopEnvironment) WithServiceManager ¶
func (n *NoopEnvironment) WithServiceManager(_ ServiceManager) Environment
type NoopEvents ¶
type NoopEvents struct { NoopHealth NoopServiceManager }
func NewNoopEvents ¶
func NewNoopEvents() *NoopEvents
func (*NoopEvents) Send ¶
func (n *NoopEvents) Send(_ context.Context, _ domains.EventRequest) error
func (*NoopEvents) SendBulk ¶
func (n *NoopEvents) SendBulk(_ context.Context, _ []domains.EventRequest) error
func (*NoopEvents) WithServiceManager ¶
func (n *NoopEvents) WithServiceManager(_ ServiceManager) Events
type NoopHealth ¶
type NoopHealth struct{}
type NoopHttpServer ¶
type NoopHttpServer struct { NoopHealth NoopServiceManager }
func NewNoopHttpServer ¶
func NewNoopHttpServer() *NoopHttpServer
func (*NoopHttpServer) Run ¶
func (n *NoopHttpServer) Run() error
func (*NoopHttpServer) WithServiceManager ¶
func (n *NoopHttpServer) WithServiceManager(_ ServiceManager) HttpServer
type NoopLogger ¶
type NoopLogger struct { NoopHealth NoopServiceManager }
func NewNoopLogger ¶
func NewNoopLogger() *NoopLogger
func (*NoopLogger) Error ¶
func (n *NoopLogger) Error(_ context.Context, _ string, _ ...map[string]interface{})
func (*NoopLogger) Fatal ¶
func (n *NoopLogger) Fatal(_ context.Context, _ string, _ ...map[string]interface{})
func (*NoopLogger) Info ¶
func (n *NoopLogger) Info(_ context.Context, _ string, _ ...map[string]interface{})
func (*NoopLogger) Warn ¶
func (n *NoopLogger) Warn(_ context.Context, _ string, _ ...map[string]interface{})
func (*NoopLogger) WithCallerCount ¶
func (n *NoopLogger) WithCallerCount(_ int) Logger
func (*NoopLogger) WithServiceManager ¶
func (n *NoopLogger) WithServiceManager(_ ServiceManager) Logger
type NoopServiceManager ¶
type NoopServiceManager struct{}
func (*NoopServiceManager) Close ¶
func (n *NoopServiceManager) Close() error
func (*NoopServiceManager) ServiceManager ¶
func (n *NoopServiceManager) ServiceManager() ServiceManager
type NoopSpans ¶
type NoopSpans struct { NoopHealth NoopServiceManager }
func NewNoopSpans ¶
func NewNoopSpans() *NoopSpans
func (*NoopSpans) WithServiceManager ¶
func (n *NoopSpans) WithServiceManager(_ ServiceManager) Spans
type NoopUsersHandler ¶
type NoopUsersHandler struct { NoopHealth NoopServiceManager }
func NewNoopUserHandler ¶
func NewNoopUserHandler() *NoopUsersHandler
func (*NoopUsersHandler) Create ¶
func (n *NoopUsersHandler) Create(_ context.Context, _ domains.UserCreate) (*domains.User, error)
func (*NoopUsersHandler) Update ¶
func (n *NoopUsersHandler) Update(_ context.Context, _ domains.UserUpdate) (*domains.User, error)
func (*NoopUsersHandler) WithServiceManager ¶
func (n *NoopUsersHandler) WithServiceManager(_ ServiceManager) UsersHandler
type NoopUsersRepository ¶
type NoopUsersRepository struct { NoopHealth NoopServiceManager }
func NewNoopUsersRepository ¶
func NewNoopUsersRepository() *NoopUsersRepository
func (*NoopUsersRepository) Migrate ¶
func (n *NoopUsersRepository) Migrate(_ context.Context) error
func (*NoopUsersRepository) Search ¶
func (n *NoopUsersRepository) Search(_ context.Context, _ domains.UserSearch) ([]domains.User, error)
func (*NoopUsersRepository) WithServiceManager ¶
func (n *NoopUsersRepository) WithServiceManager(_ ServiceManager) UsersRepository
type NoopValidator ¶
type NoopValidator struct { NoopHealth NoopServiceManager }
func NewNoopValidator ¶
func NewNoopValidator() *NoopValidator
func (*NoopValidator) Validate ¶
func (n *NoopValidator) Validate(_ context.Context, _ interface{}) error
func (*NoopValidator) ValidateSlice ¶
func (n *NoopValidator) ValidateSlice(_ context.Context, _ interface{}) error
func (*NoopValidator) WithServiceManager ¶
func (n *NoopValidator) WithServiceManager(_ ServiceManager) Validator
type ServiceManager ¶
type ServiceManager interface { Init() error Close() error Readiness(ctx context.Context) error Liveness(ctx context.Context) error Context() context.Context WithLogger(d Logger) ServiceManager Logger() Logger WithHttpServer(d HttpServer) ServiceManager HttpServer() HttpServer WithEnvironment(d Environment) ServiceManager Environment() Environment WithValidator(d Validator) ServiceManager Validator() Validator WithSpans(d Spans) ServiceManager Spans() Spans WithUserDatabase(d Database) ServiceManager UserDatabase() Database WithUsersRepository(d UsersRepository) ServiceManager UsersRepository() UsersRepository WithUsersHandler(d UsersHandler) ServiceManager UsersHandler() UsersHandler WithUsersEvents(d Events) ServiceManager UsersEvents() Events }
type UsersHandler ¶
type UsersHandler interface { Generic WithServiceManager(c ServiceManager) UsersHandler Create(ctx context.Context, c domains.UserCreate) (*domains.User, error) Update(ctx context.Context, c domains.UserUpdate) (*domains.User, error) Get(ctx context.Context, productId string) (*domains.User, error) List(ctx context.Context) ([]domains.User, error) Delete(ctx context.Context, productId string) (*domains.User, error) }
type UsersRepository ¶
type UsersRepository interface { Generic WithServiceManager(ServiceManager) UsersRepository Search(ctx context.Context, search domains.UserSearch) ([]domains.User, error) Create(ctx context.Context, product *domains.User) error Update(ctx context.Context, product *domains.User) error Delete(ctx context.Context, product *domains.User) error Migrate(ctx context.Context) error }
Click to show internal directories.
Click to hide internal directories.