Documentation ¶
Index ¶
- type Cache
- type Database
- type Environment
- type Generic
- type GrpcServer
- type Handlers
- type Logger
- type NoopCache
- type NoopDatabase
- type NoopEnvironment
- func (n *NoopEnvironment) CacheAddress() string
- func (n *NoopEnvironment) Close() error
- func (n *NoopEnvironment) DatabaseDsn() string
- func (n *NoopEnvironment) DebugPprof() bool
- func (n *NoopEnvironment) Environment() string
- func (n *NoopEnvironment) Init(_ context.Context) error
- func (n *NoopEnvironment) Service() string
- func (n *NoopEnvironment) ServiceManager() ServiceManager
- func (n *NoopEnvironment) Version() string
- func (n *NoopEnvironment) WithServiceManager(_ ServiceManager) Environment
- type NoopGrpcServer
- func (n *NoopGrpcServer) Address() string
- func (n *NoopGrpcServer) Close() error
- func (n *NoopGrpcServer) Init(_ context.Context) error
- func (n *NoopGrpcServer) Run() error
- func (n *NoopGrpcServer) ServiceManager() ServiceManager
- func (n *NoopGrpcServer) WithServiceManager(_ ServiceManager) GrpcServer
- type NoopHandlers
- func (n *NoopHandlers) Close() error
- func (n *NoopHandlers) CreateUser(_ context.Context, _ *models.User) error
- func (n *NoopHandlers) DeleteUser(_ context.Context, _ *models.User) error
- func (n *NoopHandlers) GetUser(_ context.Context, _ *models.User) error
- func (n *NoopHandlers) GetUsers(_ context.Context, _ *[]models.User) error
- func (n *NoopHandlers) Init(_ context.Context) error
- func (n *NoopHandlers) ServiceManager() ServiceManager
- func (n *NoopHandlers) UpdateUser(_ context.Context, _ *models.User) error
- func (n *NoopHandlers) WithServiceManager(_ ServiceManager) Handlers
- type NoopLogger
- func (n *NoopLogger) Close() error
- 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) Init(_ context.Context) error
- func (n *NoopLogger) ServiceManager() ServiceManager
- func (n *NoopLogger) Warn(_ context.Context, _ string, _ ...map[string]interface{})
- func (n *NoopLogger) WithServiceManager(_ ServiceManager) Logger
- type ServiceManager
- type ServiceManagerImpl
- func (s *ServiceManagerImpl) Cache() Cache
- func (s *ServiceManagerImpl) Close() error
- func (s *ServiceManagerImpl) Context() context.Context
- func (s *ServiceManagerImpl) Database() Database
- func (s *ServiceManagerImpl) Environment() Environment
- func (s *ServiceManagerImpl) GrpcServer() GrpcServer
- func (s *ServiceManagerImpl) Handlers() Handlers
- func (s *ServiceManagerImpl) Init() error
- func (s *ServiceManagerImpl) Logger() Logger
- func (s *ServiceManagerImpl) WithCache(d Cache) ServiceManager
- func (s *ServiceManagerImpl) WithDatabase(d Database) ServiceManager
- func (s *ServiceManagerImpl) WithEnvironment(d Environment) ServiceManager
- func (s *ServiceManagerImpl) WithGrpcServer(d GrpcServer) ServiceManager
- func (s *ServiceManagerImpl) WithHandlers(d Handlers) ServiceManager
- func (s *ServiceManagerImpl) WithLogger(d Logger) ServiceManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Generic WithServiceManager(c ServiceManager) Cache }
type Environment ¶
type Environment interface { Generic WithServiceManager(c ServiceManager) Environment Environment() string Service() string Version() string DebugPprof() bool DatabaseDsn() string CacheAddress() string }
type Generic ¶
type Generic interface { ServiceManager() ServiceManager Init(ctx context.Context) error Close() error }
type GrpcServer ¶
type GrpcServer interface { Generic WithServiceManager(c ServiceManager) GrpcServer Address() string Run() error }
type Handlers ¶
type Handlers interface { Generic WithServiceManager(c ServiceManager) Handlers CreateUser(ctx context.Context, u *models.User) error UpdateUser(ctx context.Context, u *models.User) error GetUser(ctx context.Context, u *models.User) error GetUsers(ctx context.Context, u *[]models.User) error DeleteUser(ctx context.Context, u *models.User) error }
type Logger ¶
type Logger interface { Generic WithServiceManager(c ServiceManager) 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 NoopCache ¶
type NoopCache struct{}
func NewNoopCache ¶
func NewNoopCache() *NoopCache
func (*NoopCache) ServiceManager ¶
func (n *NoopCache) ServiceManager() ServiceManager
func (*NoopCache) WithServiceManager ¶
func (n *NoopCache) WithServiceManager(_ ServiceManager) Cache
type NoopDatabase ¶
type NoopDatabase struct{}
func NewNoopDatabase ¶
func NewNoopDatabase() *NoopDatabase
func (*NoopDatabase) Close ¶
func (n *NoopDatabase) Close() error
func (*NoopDatabase) ServiceManager ¶
func (n *NoopDatabase) ServiceManager() ServiceManager
func (*NoopDatabase) WithServiceManager ¶
func (n *NoopDatabase) WithServiceManager(_ ServiceManager) Database
type NoopEnvironment ¶
type NoopEnvironment struct{}
func NewNoopEnvironment ¶
func NewNoopEnvironment() *NoopEnvironment
func (*NoopEnvironment) CacheAddress ¶
func (n *NoopEnvironment) CacheAddress() string
func (*NoopEnvironment) Close ¶
func (n *NoopEnvironment) Close() error
func (*NoopEnvironment) DatabaseDsn ¶
func (n *NoopEnvironment) DatabaseDsn() string
func (*NoopEnvironment) DebugPprof ¶
func (n *NoopEnvironment) DebugPprof() bool
func (*NoopEnvironment) Environment ¶
func (n *NoopEnvironment) Environment() string
func (*NoopEnvironment) Service ¶
func (n *NoopEnvironment) Service() string
func (*NoopEnvironment) ServiceManager ¶
func (n *NoopEnvironment) ServiceManager() ServiceManager
func (*NoopEnvironment) Version ¶
func (n *NoopEnvironment) Version() string
func (*NoopEnvironment) WithServiceManager ¶
func (n *NoopEnvironment) WithServiceManager(_ ServiceManager) Environment
type NoopGrpcServer ¶
type NoopGrpcServer struct{}
func NewNoopGrpcServer ¶
func NewNoopGrpcServer() *NoopGrpcServer
func (*NoopGrpcServer) Address ¶
func (n *NoopGrpcServer) Address() string
func (*NoopGrpcServer) Close ¶
func (n *NoopGrpcServer) Close() error
func (*NoopGrpcServer) Run ¶
func (n *NoopGrpcServer) Run() error
func (*NoopGrpcServer) ServiceManager ¶
func (n *NoopGrpcServer) ServiceManager() ServiceManager
func (*NoopGrpcServer) WithServiceManager ¶
func (n *NoopGrpcServer) WithServiceManager(_ ServiceManager) GrpcServer
type NoopHandlers ¶
type NoopHandlers struct{}
func NewNoopHandlers ¶
func NewNoopHandlers() *NoopHandlers
func (*NoopHandlers) Close ¶
func (n *NoopHandlers) Close() error
func (*NoopHandlers) CreateUser ¶
func (*NoopHandlers) DeleteUser ¶
func (*NoopHandlers) ServiceManager ¶
func (n *NoopHandlers) ServiceManager() ServiceManager
func (*NoopHandlers) UpdateUser ¶
func (*NoopHandlers) WithServiceManager ¶
func (n *NoopHandlers) WithServiceManager(_ ServiceManager) Handlers
type NoopLogger ¶
type NoopLogger struct{}
func NewNoopLogger ¶
func NewNoopLogger() *NoopLogger
func (*NoopLogger) Close ¶
func (n *NoopLogger) Close() error
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) ServiceManager ¶
func (n *NoopLogger) ServiceManager() ServiceManager
func (*NoopLogger) Warn ¶
func (n *NoopLogger) Warn(_ context.Context, _ string, _ ...map[string]interface{})
func (*NoopLogger) WithServiceManager ¶
func (n *NoopLogger) WithServiceManager(_ ServiceManager) Logger
type ServiceManager ¶
type ServiceManager interface { WithDatabase(d Database) ServiceManager Database() Database WithCache(d Cache) ServiceManager Cache() Cache WithLogger(d Logger) ServiceManager Logger() Logger WithGrpcServer(d GrpcServer) ServiceManager GrpcServer() GrpcServer WithHandlers(d Handlers) ServiceManager Handlers() Handlers WithEnvironment(d Environment) ServiceManager Environment() Environment Context() context.Context Init() error Close() error }
type ServiceManagerImpl ¶
type ServiceManagerImpl struct {
// contains filtered or unexported fields
}
func New ¶
func New() *ServiceManagerImpl
func (*ServiceManagerImpl) Cache ¶
func (s *ServiceManagerImpl) Cache() Cache
func (*ServiceManagerImpl) Close ¶
func (s *ServiceManagerImpl) Close() error
func (*ServiceManagerImpl) Context ¶
func (s *ServiceManagerImpl) Context() context.Context
func (*ServiceManagerImpl) Database ¶
func (s *ServiceManagerImpl) Database() Database
func (*ServiceManagerImpl) Environment ¶
func (s *ServiceManagerImpl) Environment() Environment
func (*ServiceManagerImpl) GrpcServer ¶
func (s *ServiceManagerImpl) GrpcServer() GrpcServer
func (*ServiceManagerImpl) Handlers ¶
func (s *ServiceManagerImpl) Handlers() Handlers
func (*ServiceManagerImpl) Init ¶
func (s *ServiceManagerImpl) Init() error
func (*ServiceManagerImpl) Logger ¶
func (s *ServiceManagerImpl) Logger() Logger
func (*ServiceManagerImpl) WithCache ¶
func (s *ServiceManagerImpl) WithCache(d Cache) ServiceManager
func (*ServiceManagerImpl) WithDatabase ¶
func (s *ServiceManagerImpl) WithDatabase(d Database) ServiceManager
func (*ServiceManagerImpl) WithEnvironment ¶
func (s *ServiceManagerImpl) WithEnvironment(d Environment) ServiceManager
func (*ServiceManagerImpl) WithGrpcServer ¶
func (s *ServiceManagerImpl) WithGrpcServer(d GrpcServer) ServiceManager
func (*ServiceManagerImpl) WithHandlers ¶
func (s *ServiceManagerImpl) WithHandlers(d Handlers) ServiceManager
func (*ServiceManagerImpl) WithLogger ¶
func (s *ServiceManagerImpl) WithLogger(d Logger) ServiceManager
Click to show internal directories.
Click to hide internal directories.