services

package
v0.0.0-...-3e4a122 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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 Database

type Database interface {
	Generic
	WithServiceManager(c ServiceManager) Database
	DB(ctx context.Context) *gorm.DB
}

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) Close

func (n *NoopCache) Close() error

func (*NoopCache) Init

func (n *NoopCache) Init(_ context.Context) error

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) DB

func (n *NoopDatabase) DB(_ context.Context) *gorm.DB

func (*NoopDatabase) Init

func (n *NoopDatabase) Init(_ context.Context) 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) Init

func (n *NoopEnvironment) Init(_ context.Context) error

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) Init

func (n *NoopGrpcServer) Init(_ context.Context) 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 (n *NoopHandlers) CreateUser(_ context.Context, _ *models.User) error

func (*NoopHandlers) DeleteUser

func (n *NoopHandlers) DeleteUser(_ context.Context, _ *models.User) error

func (*NoopHandlers) GetUser

func (n *NoopHandlers) GetUser(_ context.Context, _ *models.User) error

func (*NoopHandlers) GetUsers

func (n *NoopHandlers) GetUsers(_ context.Context, _ *[]models.User) error

func (*NoopHandlers) Init

func (n *NoopHandlers) Init(_ context.Context) error

func (*NoopHandlers) ServiceManager

func (n *NoopHandlers) ServiceManager() ServiceManager

func (*NoopHandlers) UpdateUser

func (n *NoopHandlers) UpdateUser(_ context.Context, _ *models.User) error

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) Init

func (n *NoopLogger) Init(_ context.Context) error

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

Jump to

Keyboard shortcuts

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