Documentation
¶
Index ¶
- Constants
- func NewDaemon(services ...*ServiceContext) *daemon
- func NewServiceOpts(options ...ServiceOption) *serviceOpts
- type Level
- type LogMessage
- type LogSeverity
- type Logger
- func (l *Logger) Debug(v ...any)
- func (l *Logger) Debugf(format string, v ...any)
- func (l *Logger) Error(v ...any)
- func (l *Logger) Errorf(format string, v ...any)
- func (l *Logger) Info(v ...any)
- func (l *Logger) Infof(format string, v ...any)
- func (l *Logger) Warn(v ...any)
- func (l *Logger) Warnf(format string, v ...any)
- type Logging
- type RunPolicy
- type Service
- type ServiceContext
- func (sc *ServiceContext) AddDependentService(s *ServiceContext, states ...State) error
- func (sc *ServiceContext) ChangeState() chan State
- func (sc *ServiceContext) IntracomPublish(topic string, message []byte)
- func (sc *ServiceContext) IntracomSubscribe(topic string, id string) <-chan []byte
- func (sc *ServiceContext) IntracomUnsubscribe(topic string, id string)
- func (sc *ServiceContext) ShutdownSignal() <-chan struct{}
- type ServiceOption
- type ServiceResponse
- type State
Constants ¶
View Source
const (
InternalServiceStates = "_rxd.states"
)
View Source
const (
NoFlags = 0
)
Variables ¶
This section is empty.
Functions ¶
func NewDaemon ¶
func NewDaemon(services ...*ServiceContext) *daemon
NewDaemon creates and return an instance of the reactive daemon
func NewServiceOpts ¶
func NewServiceOpts(options ...ServiceOption) *serviceOpts
NewServiceOpts will apply all options in the order given and return the final options back.
Types ¶
type LogMessage ¶
func NewLog ¶
func NewLog(message string, level Level) LogMessage
NewLog creates a new instance of a LogMessage from a string and level.
type LogSeverity ¶
type LogSeverity int
LogSeverity is a typed int that represents the severity of the logging levels.
const ( // LevelAll will show all severity levels LevelAll LogSeverity = 0 // LevelDebug will show all severity levels at Debug and above: Debug, Info, Error LevelDebug LogSeverity = 1 // LevelInfo will show all severity levels at Info and above: Info, Error LevelInfo LogSeverity = 2 // LevelWarn will show all severity levels at Warn and above: Warn, Error LevelWarn LogSeverity = 3 // LevelError will show all severity levels at Error and above: Error LevelError LogSeverity = 4 // LevelOff will not show any logs, logging will be off LevelOff LogSeverity = 6 )
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewLogger ¶
func NewLogger(logSeverity LogSeverity, flags int) *Logger
NewLogger returns an instance of Logger with Debug, Info and Error loggers. Each logger is configured with sane defaults. Debug output is set with env var "DEBUG"; defaults to io.Discard