Documentation ¶
Index ¶
- Constants
- Variables
- func Cleanup(unique string)
- func ClearAgents()
- func Download(p *configurations.Agent) error
- func DownloadURL(p *configurations.Agent) string
- func Load[P AgentContext, Instance any](p *configurations.Agent, unique string, opts ...Option) (*Instance, error)
- func NewServerLogger() hclog.Logger
- func NoLogger() hclog.Logger
- func Register(agents ...AgentImplementation)
- func RegisterLogCallback(callback LogCallback)
- func ToKind(s string) agentsv1.Log_Kind
- type Agent
- type AgentContext
- type AgentImplementation
- type AgentLogger
- func (l *AgentLogger) Catch()
- func (l *AgentLogger) DebugMe(format string, args ...any)
- func (l *AgentLogger) Debugf(format string, args ...any)
- func (l *AgentLogger) Errorf(format string, args ...any) error
- func (l *AgentLogger) Info(format string, args ...any)
- func (l *AgentLogger) NewLogEntry(b []byte) LogEntry
- func (l *AgentLogger) SetDebug()
- func (l *AgentLogger) SetLevel(lvl shared.LogLevel)
- func (l *AgentLogger) SetTrace()
- func (l *AgentLogger) TODO(format string, args ...any)
- func (l *AgentLogger) Tracef(format string, args ...any)
- func (l *AgentLogger) UnsafeWrite(s string)
- func (l *AgentLogger) Warn(format string, args ...any)
- func (l *AgentLogger) Wrapf(err error, format string, args ...any) error
- func (l *AgentLogger) Write(b []byte) (n int, err error)
- func (l *AgentLogger) WriteEntry(entry LogEntry) (n int, err error)
- type ColorPicker
- type LogCallback
- type LogEntry
- type LogMessage
- type LogMessageContent
- type Option
- type Options
- type Pluggable
- type ServerFormatter
- type ServiceLogger
- func (l *ServiceLogger) DebugMe(format string, args ...any)
- func (l *ServiceLogger) Debugf(format string, args ...any)
- func (l *ServiceLogger) Errorf(format string, args ...any) error
- func (l *ServiceLogger) Info(format string, args ...any)
- func (l *ServiceLogger) SetLevel(lvl shared.LogLevel)
- func (l *ServiceLogger) TODO(format string, args ...any)
- func (l *ServiceLogger) Tracef(format string, args ...any)
- func (l *ServiceLogger) UnsafeWrite(s string)
- func (l *ServiceLogger) Wrapf(err error, format string, args ...any) error
- func (l *ServiceLogger) Write(p []byte) (n int, err error)
Constants ¶
View Source
const ( AgentKind = "agent" ServiceKind = "service" )
View Source
const ( InitError = servicev1.InitStatus_ERROR InitSuccess = servicev1.InitStatus_READY )
Variables ¶
View Source
var HandshakeConfig = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "codefly::agents",
MagicCookieValue: "0.0.0",
}
Functions ¶
func ClearAgents ¶
func ClearAgents()
func Download ¶
func Download(p *configurations.Agent) error
func DownloadURL ¶
func DownloadURL(p *configurations.Agent) string
func Load ¶
func Load[P AgentContext, Instance any](p *configurations.Agent, unique string, opts ...Option) (*Instance, error)
func NewServerLogger ¶
func NewServerLogger() hclog.Logger
func Register ¶
func Register(agents ...AgentImplementation)
func RegisterLogCallback ¶
func RegisterLogCallback(callback LogCallback)
Types ¶
type Agent ¶
type Agent struct { Configuration *configurations.Agent Type string Implementation plugin.Plugin }
type AgentContext ¶
type AgentContext interface { Key(p *configurations.Agent, unique string) string Default() plugin.Plugin }
type AgentImplementation ¶
type AgentImplementation struct { Agent plugin.Plugin Configuration *configurations.Agent }
type AgentLogger ¶
type AgentLogger struct { AgentIdentifier string Service string Application string // contains filtered or unexported fields }
func NewAgentLogger ¶
func NewAgentLogger(identity *servicev1.ServiceIdentity, agent *configurations.Agent) *AgentLogger
func (*AgentLogger) Catch ¶
func (l *AgentLogger) Catch()
func (*AgentLogger) DebugMe ¶
func (l *AgentLogger) DebugMe(format string, args ...any)
func (*AgentLogger) Debugf ¶
func (l *AgentLogger) Debugf(format string, args ...any)
func (*AgentLogger) Info ¶
func (l *AgentLogger) Info(format string, args ...any)
func (*AgentLogger) NewLogEntry ¶
func (l *AgentLogger) NewLogEntry(b []byte) LogEntry
func (*AgentLogger) SetDebug ¶
func (l *AgentLogger) SetDebug()
func (*AgentLogger) SetLevel ¶
func (l *AgentLogger) SetLevel(lvl shared.LogLevel)
func (*AgentLogger) SetTrace ¶
func (l *AgentLogger) SetTrace()
func (*AgentLogger) TODO ¶
func (l *AgentLogger) TODO(format string, args ...any)
func (*AgentLogger) Tracef ¶
func (l *AgentLogger) Tracef(format string, args ...any)
func (*AgentLogger) UnsafeWrite ¶
func (l *AgentLogger) UnsafeWrite(s string)
func (*AgentLogger) Warn ¶
func (l *AgentLogger) Warn(format string, args ...any)
func (*AgentLogger) Wrapf ¶
func (l *AgentLogger) Wrapf(err error, format string, args ...any) error
func (*AgentLogger) WriteEntry ¶
func (l *AgentLogger) WriteEntry(entry LogEntry) (n int, err error)
type ColorPicker ¶
type ColorPicker struct {
// contains filtered or unexported fields
}
func NewColorPicker ¶
func NewColorPicker() *ColorPicker
type LogCallback ¶
type LogMessage ¶
type LogMessage struct { Level string `json:"@level"` Timestamp time.Time `json:"@timestamp"` RawMessage string `json:"@message"` Message LogMessageContent }
type LogMessageContent ¶
type Option ¶
type Option = func(options *Options)
func WithApplication ¶
func WithApplication(app *configurations.Application) Option
type Options ¶
type Options struct { Quiet bool Application *configurations.Application }
type ServerFormatter ¶
type ServerFormatter struct {
// contains filtered or unexported fields
}
func NewServerFormatter ¶
func NewServerFormatter(debug bool) *ServerFormatter
type ServiceLogger ¶
type ServiceLogger struct { AgentIdentifier string Service string Application string JSON bool // contains filtered or unexported fields }
func NewServiceLogger ¶
func NewServiceLogger(identity *servicev1.ServiceIdentity, agent *configurations.Agent) *ServiceLogger
func (*ServiceLogger) DebugMe ¶
func (l *ServiceLogger) DebugMe(format string, args ...any)
func (*ServiceLogger) Debugf ¶
func (l *ServiceLogger) Debugf(format string, args ...any)
func (*ServiceLogger) Info ¶
func (l *ServiceLogger) Info(format string, args ...any)
func (*ServiceLogger) SetLevel ¶
func (l *ServiceLogger) SetLevel(lvl shared.LogLevel)
func (*ServiceLogger) TODO ¶
func (l *ServiceLogger) TODO(format string, args ...any)
func (*ServiceLogger) Tracef ¶
func (l *ServiceLogger) Tracef(format string, args ...any)
func (*ServiceLogger) UnsafeWrite ¶
func (l *ServiceLogger) UnsafeWrite(s string)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.