Documentation ¶
Index ¶
Constants ¶
View Source
const AppLoggerName = "gofar"
Variables ¶
View Source
var ErrGracefulShutdown = errors.New("graceful shutdown")
Functions ¶
Types ¶
type BaseAppConfig ¶ added in v0.0.5
type BaseAppConfig struct { // ServiceName is the identifier of the service ServiceName string `yaml:"service_name"` // LoggingConfig is the configuration of the logs LoggingConfig LoggingConfig `yaml:"logs"` // BuildInfo is the information of the build. Useful to identify running process for observability. BuildInfo *BuildInfo }
BaseAppConfig is the base configuration for the service, it needs a name, a log level, a log format, and an observability mode.
func (*BaseAppConfig) ServiceVersionedName ¶ added in v0.0.5
func (c *BaseAppConfig) ServiceVersionedName() string
ServiceVersionedName returns the service name with the version if it exists, useful to group equal running services
type BaseService ¶
type BaseService[V any] struct { Cfg V }
type BuildInfo ¶ added in v0.0.5
BuildInfo is the information of the build, it contains the version, the commit and the date.
type Config ¶
type Config interface {
Framework() *BaseAppConfig
}
type InfoServer ¶
InfoServer contains the information of a server to be started.
type LoggingConfig ¶ added in v0.0.5
type LoggingConfig struct { // Level is the log level (debug, info, warn, error, fatal, panic) Level string `yaml:"level"` // Format is the log format (text, json) Format string `yaml:"format"` // Output is the log output (stdout, stderr, file) Output string `yaml:"output"` // FilteredChannels is the list of channels to filter [channel: level] FilteredChannels map[string]string `yaml:"filtered_channels"` }
type RunnableServer ¶
type Service ¶
type Service[K App[V], V Config] struct { BaseService[V] // contains filtered or unexported fields }
func NewService ¶
NewService creates a new service with the given app and config. This is the main and only entry point for the GoForARun framework.
Click to show internal directories.
Click to hide internal directories.