Documentation
¶
Index ¶
- Variables
- type Application
- type Option
- func WithAuth(authManager auth.AuthManager) Option
- func WithCache(c cache.Cache) Option
- func WithDB(db *gorm.DB) Option
- func WithEventBus(eventBus messaging.EventBus) Option
- func WithGRPCServer(grpcServer grpc.GRPCServer) Option
- func WithLogger(l logger.Logger) Option
- func WithName(name string) Option
- func WithVersion(version string) Option
- func Withhttp(http http.HTTPServer) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EventBus messaging.EventBus Logger logger.Logger HTTPServer http.HTTPServer GRPCServer grpc.GRPCServer AuthManager auth.AuthManager DB *gorm.DB )
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application interface {
RegisterModules(ctx context.Context, modules ...module.Module) error
GrpcServer() grpc.GRPCServer
HTTPServer() http.HTTPServer
Start(ctx context.Context) error
Options() *Options
}
Application defines the interface for the application.
func NewApplication ¶
func NewApplication(opts ...Option) Application
type Option ¶
type Option func(*Options)
Option defines a function type to configure Options
func WithAuth ¶ added in v0.10.0
func WithAuth(authManager auth.AuthManager) Option
func WithEventBus ¶
WithEventBus sets the EventBus dependency.
func WithGRPCServer ¶ added in v0.9.0
func WithGRPCServer(grpcServer grpc.GRPCServer) Option
WithGRPCServer sets the GRPCServer dependency.
func WithVersion ¶
WithVersion sets the application version.
func Withhttp ¶ added in v0.11.0
func Withhttp(http http.HTTPServer) Option
Withhttp sets the http dependency.
type Options ¶
type Options struct {
Name string // Application name
Version string // Application version
Cache cache.Cache // Cache instance
Logger logger.Logger // Logger instance
EventBus messaging.EventBus // Event bus instance for inter-component communication
GRPCServer grpc.GRPCServer // gRPC server instance; optional
DB *gorm.DB
AuthManager auth.AuthManager
// contains filtered or unexported fields
}
Options holds both configuration values and runtime dependencies
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cache is a generated GoMock package.
|
Package cache is a generated GoMock package. |
|
store
Package store is a generated GoMock package.
|
Package store is a generated GoMock package. |
|
Package logger is a generated GoMock package.
|
Package logger is a generated GoMock package. |
|
security
|
|
Click to show internal directories.
Click to hide internal directories.