Documentation
¶
Index ¶
- type Application
- type Option
- func WithCache(c cache.Cache) Option
- func WithEventBus(eventBus messaging.EventBus) Option
- func WithGRPCServer(grpcServer grpc.GRPCServer) Option
- func WithHTTPServer(httpServer httpserver.HTTPServer) Option
- func WithLogger(l logger.Logger) Option
- func WithName(name string) Option
- func WithVersion(version string) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application interface {
RegisterModules(ctx context.Context, modules ...module.Module) error
GrpcServer() grpc.GRPCServer
HTTPServer() httpserver.HTTPServer
Start(ctx context.Context) error
Options() *Options
}
Application defines the interface for the application.
func NewApplication ¶
func NewApplication(opts ...Option) Application
NewApplication creates a new instance of Application with the provided options. It initializes the application configuration, web server, gRPC server, and module manager.
Parameters:
opts - A variadic list of Option functions to configure the application.
Returns:
An instance of Application.
type Option ¶
type Option func(*Options)
Option defines a function type to configure Options
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 WithHTTPServer ¶ added in v0.9.1
func WithHTTPServer(httpServer httpserver.HTTPServer) Option
WithHTTPServer sets the HTTPServer dependency.
func WithVersion ¶
WithVersion sets the application version.
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
HTTPServer httpserver.HTTPServer // HTTP server instance
GRPCServer grpc.GRPCServer // gRPC server instance; optional
}
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. |
Click to show internal directories.
Click to hide internal directories.