Documentation
¶
Index ¶
- type AggregateStatistics
- type Config
- type LogServer
- func (l *LogServer) AddToken(service, instance string) (string, error)
- func (l *LogServer) AggregateServiceStatistics() (totalVolume int64, services []*AggregateStatistics, hourly [24][2]int64)
- func (l *LogServer) Authorize(ctx context.Context) error
- func (l *LogServer) GatherStatistics(service, instance, key, ip string, logEntry *logrpc.LogEntry)
- func (l *LogServer) KillSwitch() chan bool
- func (l *LogServer) Logfiles() (map[string]string, error)
- func (l *LogServer) Quit()
- func (l *LogServer) RemoteLog(ctx context.Context, logEntry *logrpc.LogEntry) (*logrpc.Nothing, error)
- func (l *LogServer) RemoveToken(service, instance string, lock bool) error
- func (l *LogServer) RemoveTokens(service string) error
- type ManagementConsole
- type Statistic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateStatistics ¶
type AggregateStatistics struct {
// contains filtered or unexported fields
}
AggregateStatistics contains aggregated logging statistics
type Config ¶
type Config struct {
// Remote logger config
Host string
Port int
UnixSockPath string
TokenPath string
StatsPath string
// Local logger config
LoggerConfig *journal.Config
}
Config contains all the configuration for the remote logger
type LogServer ¶
type LogServer struct {
*sync.Mutex // Mutex for tokens and statistics
// contains filtered or unexported fields
}
LogServer implements log.Logger and log.RemoteLoggerServer interfaces
func (*LogServer) AddToken ¶
AddToken creates a new token for the service/instance if it does not yet exist
func (*LogServer) AggregateServiceStatistics ¶
func (l *LogServer) AggregateServiceStatistics() (totalVolume int64, services []*AggregateStatistics, hourly [24][2]int64)
AggregateServiceStatistics aggregates statistics
func (*LogServer) GatherStatistics ¶
GatherStatistics saves log-related statistics
func (*LogServer) KillSwitch ¶
KillSwitch returns the internal killswitch
func (*LogServer) RemoteLog ¶
func (l *LogServer) RemoteLog(ctx context.Context, logEntry *logrpc.LogEntry) (*logrpc.Nothing, error)
RemoteLog handles incoming remote logs
func (*LogServer) RemoveToken ¶
RemoveToken removes an authentication token
func (*LogServer) RemoveTokens ¶
RemoveTokens removes all the authentication tokens of a service
type ManagementConsole ¶
type ManagementConsole interface {
// CmdStatistics displays various statistics
CmdStatistics(unixsock.Args) *unixsock.Response
// CmdLogsList list all available logfiles and their archives
CmdLogsList(unixsock.Args) *unixsock.Response
// CmdRemoteAdd adds a remote backend
CmdRemoteAdd(unixsock.Args) *unixsock.Response
// CmdRemoteList lists all active remote backends
CmdRemoteList(unixsock.Args) *unixsock.Response
// CmdRemoteRemove removes a remote backend
CmdRemoteRemove(unixsock.Args) *unixsock.Response
// CmdTokensAdd adds a new token for a service/instance
CmdTokensAdd(unixsock.Args) *unixsock.Response
// CmdTokensListInstances lists all permitted instances of a service
CmdTokensListInstances(unixsock.Args) *unixsock.Response
// CmdTokensListServices lists all permitted services
CmdTokensListServices(unixsock.Args) *unixsock.Response
// CmdTokensRemoveInstance removes the token of a service/instance
CmdTokensRemoveInstance(unixsock.Args) *unixsock.Response
// CmdTokensRemoveService removes the token of all instances of a service
CmdTokensRemoveService(unixsock.Args) *unixsock.Response
// Execute is the executor of management console commands
Execute(string, unixsock.Args) *unixsock.Response
}
ManagementConsole handles commands received over the unix socket
func NewConsole ¶
func NewConsole(server *LogServer) ManagementConsole
NewConsole creates a new management console for the log server