Documentation ¶
Index ¶
- func New() *serviceManager
- type Database
- type DatabaseTransaction
- type Discounts
- 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) WithProductDatabase() Database
- func (n *NoopDatabase) WithReplicaClient(_ *sql.DB) Database
- func (n *NoopDatabase) WithServiceManager(_ ServiceManager) Database
- type NoopDiscounts
- 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) DiscountsAddress() string
- func (n *NoopEnvironment) Env() string
- func (n *NoopEnvironment) LockerConfigDynamoTable() string
- func (n *NoopEnvironment) ProductDatabaseDsn() string
- func (n *NoopEnvironment) ProductReplicaDatabaseDsn() string
- func (n *NoopEnvironment) ProductTopicAddress() string
- func (n *NoopEnvironment) Service() string
- func (n *NoopEnvironment) SpanUrl() string
- func (n *NoopEnvironment) StatsdServer() 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 NoopProductsHandler
- func (n *NoopProductsHandler) Create(_ context.Context, _ domains.ProductCreate) (*domains.Product, error)
- func (n *NoopProductsHandler) Delete(_ context.Context, _ string) (*domains.Product, error)
- func (n *NoopProductsHandler) Get(_ context.Context, _ string) (*domains.Product, error)
- func (n *NoopProductsHandler) List(_ context.Context) ([]domains.Product, error)
- func (n *NoopProductsHandler) Update(_ context.Context, _ domains.ProductUpdate) (*domains.Product, error)
- func (n *NoopProductsHandler) WithServiceManager(_ ServiceManager) ProductsHandler
- type NoopProductsRepository
- func (n *NoopProductsRepository) Create(_ context.Context, _ *domains.Product) error
- func (n *NoopProductsRepository) Delete(_ context.Context, _ *domains.Product) error
- func (n *NoopProductsRepository) Migrate(_ context.Context) error
- func (n *NoopProductsRepository) Search(_ context.Context, _ domains.ProductSearch) ([]domains.Product, error)
- func (n *NoopProductsRepository) Update(_ context.Context, _ *domains.Product) error
- func (n *NoopProductsRepository) WithServiceManager(_ ServiceManager) ProductsRepository
- type NoopServiceManager
- type NoopSpans
- type NoopValidator
- type ProductsHandler
- type ProductsRepository
- type ServiceManager
- type Spans
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Database ¶
type Database interface { Generic WithServiceManager(c ServiceManager) Database WithProductDatabase() 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 Discounts ¶
type Discounts interface { Generic WithServiceManager(c ServiceManager) Discounts Get(ctx context.Context, req domains.DiscountRequest) (*domains.DiscountResponse, error) }
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 DiscountsAddress() string SpanUrl() string ProductDatabaseDsn() string ProductReplicaDatabaseDsn() string ProductTopicAddress() 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) WithProductDatabase ¶
func (n *NoopDatabase) WithProductDatabase() Database
func (*NoopDatabase) WithReplicaClient ¶
func (n *NoopDatabase) WithReplicaClient(_ *sql.DB) Database
func (*NoopDatabase) WithServiceManager ¶
func (n *NoopDatabase) WithServiceManager(_ ServiceManager) Database
type NoopDiscounts ¶
type NoopDiscounts struct { NoopHealth NoopServiceManager }
func NewNoopDiscounts ¶
func NewNoopDiscounts() *NoopDiscounts
func (*NoopDiscounts) Get ¶
func (n *NoopDiscounts) Get(_ context.Context, _ domains.DiscountRequest) (*domains.DiscountResponse, error)
func (*NoopDiscounts) WithServiceManager ¶
func (n *NoopDiscounts) WithServiceManager(_ ServiceManager) Discounts
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) DiscountsAddress ¶
func (n *NoopEnvironment) DiscountsAddress() string
func (*NoopEnvironment) Env ¶
func (n *NoopEnvironment) Env() string
func (*NoopEnvironment) LockerConfigDynamoTable ¶
func (n *NoopEnvironment) LockerConfigDynamoTable() string
func (*NoopEnvironment) ProductDatabaseDsn ¶
func (n *NoopEnvironment) ProductDatabaseDsn() string
func (*NoopEnvironment) ProductReplicaDatabaseDsn ¶
func (n *NoopEnvironment) ProductReplicaDatabaseDsn() string
func (*NoopEnvironment) ProductTopicAddress ¶
func (n *NoopEnvironment) ProductTopicAddress() string
func (*NoopEnvironment) Service ¶
func (n *NoopEnvironment) Service() string
func (*NoopEnvironment) SpanUrl ¶
func (n *NoopEnvironment) SpanUrl() string
func (*NoopEnvironment) StatsdServer ¶
func (n *NoopEnvironment) StatsdServer() 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 NoopProductsHandler ¶
type NoopProductsHandler struct { NoopHealth NoopServiceManager }
func NewNoopProductsHandler ¶
func NewNoopProductsHandler() *NoopProductsHandler
func (*NoopProductsHandler) Create ¶
func (n *NoopProductsHandler) Create(_ context.Context, _ domains.ProductCreate) (*domains.Product, error)
func (*NoopProductsHandler) Update ¶
func (n *NoopProductsHandler) Update(_ context.Context, _ domains.ProductUpdate) (*domains.Product, error)
func (*NoopProductsHandler) WithServiceManager ¶
func (n *NoopProductsHandler) WithServiceManager(_ ServiceManager) ProductsHandler
type NoopProductsRepository ¶
type NoopProductsRepository struct { NoopHealth NoopServiceManager }
func NewNoopProductsRepository ¶
func NewNoopProductsRepository() *NoopProductsRepository
func (*NoopProductsRepository) Migrate ¶
func (n *NoopProductsRepository) Migrate(_ context.Context) error
func (*NoopProductsRepository) Search ¶
func (n *NoopProductsRepository) Search(_ context.Context, _ domains.ProductSearch) ([]domains.Product, error)
func (*NoopProductsRepository) WithServiceManager ¶
func (n *NoopProductsRepository) WithServiceManager(_ ServiceManager) ProductsRepository
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 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 ProductsHandler ¶
type ProductsHandler interface { Generic WithServiceManager(c ServiceManager) ProductsHandler Create(ctx context.Context, c domains.ProductCreate) (*domains.Product, error) Update(ctx context.Context, c domains.ProductUpdate) (*domains.Product, error) Get(ctx context.Context, productId string) (*domains.Product, error) List(ctx context.Context) ([]domains.Product, error) Delete(ctx context.Context, productId string) (*domains.Product, error) }
type ProductsRepository ¶
type ProductsRepository interface { Generic WithServiceManager(ServiceManager) ProductsRepository Search(ctx context.Context, search domains.ProductSearch) ([]domains.Product, error) Create(ctx context.Context, product *domains.Product) error Update(ctx context.Context, product *domains.Product) error Delete(ctx context.Context, product *domains.Product) error Migrate(ctx context.Context) error }
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 WithDiscounts(d Discounts) ServiceManager Discounts() Discounts WithValidator(d Validator) ServiceManager Validator() Validator WithSpans(d Spans) ServiceManager Spans() Spans WithProductDatabase(d Database) ServiceManager ProductDatabase() Database WithProductsRepository(d ProductsRepository) ServiceManager ProductsRepository() ProductsRepository WithProductsHandler(d ProductsHandler) ServiceManager ProductsHandler() ProductsHandler WithProductsEvents(d Events) ServiceManager ProductsEvents() Events }
Click to show internal directories.
Click to hide internal directories.