Help us shape the future of Go! Take the 2026 Go Developer Survey

agents

package
v0.0.53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 28 Imported by: 6

Documentation

Index

Constants

View Source
const (
	AgentKind   = "agent"
	ServiceKind = "service"
)
View Source
const (
	WARN = "WARN"
)

Variables

View Source
var HandshakeConfig = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "codefly::agents",
	MagicCookieValue: "0.0.0",
}

Functions

func Cleanup

func Cleanup(unique string)

func ClearAgents

func ClearAgents()

func Download

func Download(ctx context.Context, p *configurations.Agent) error

func DownloadURL

func DownloadURL(p *configurations.Agent) string

func Load

func Load[P AgentContext, Instance any](ctx context.Context, p *configurations.Agent, unique string) (*Instance, error)

func NewServerLogger

func NewServerLogger() hclog.Logger

func NoLogger

func NoLogger() hclog.Logger

func PinToLatestRelease added in v0.0.41

func PinToLatestRelease(agent *configurations.Agent) error

func Register

func Register(agents ...AgentImplementation)

func RegisterLogCallback

func RegisterLogCallback(callback LogCallback)

func ToKind

func ToKind(s string) obsv1.Log_Kind

func ValidURL added in v0.0.51

func ValidURL(s string) bool

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 *basev1.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) Errorf

func (l *AgentLogger) Errorf(format string, args ...any) error

func (*AgentLogger) Info

func (l *AgentLogger) Info(format string, args ...any)

func (*AgentLogger) NewLogEntry

func (l *AgentLogger) NewLogEntry(b []byte) *LogEntry

func (*AgentLogger) Oops added in v0.0.51

func (l *AgentLogger) Oops(format string, args ...any)

func (*AgentLogger) SetDebug

func (l *AgentLogger) SetDebug()

func (*AgentLogger) SetLevel

func (l *AgentLogger) SetLevel(lvl shared.LogLevel) shared.BaseLogger

func (*AgentLogger) SetLogMethod added in v0.0.51

func (l *AgentLogger) SetLogMethod(actions shared.LogMode) shared.BaseLogger

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) WarnOnError added in v0.0.51

func (l *AgentLogger) WarnOnError(err error)

func (*AgentLogger) With added in v0.0.51

func (l *AgentLogger) With(_ string, _ ...any) shared.BaseLogger

func (*AgentLogger) Wrap added in v0.0.51

func (l *AgentLogger) Wrap(err error) error

func (*AgentLogger) Wrapf

func (l *AgentLogger) Wrapf(err error, format string, args ...any) error

func (*AgentLogger) Write

func (l *AgentLogger) Write(b []byte) (n int, err 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

func (*ColorPicker) PickStyle

func (cp *ColorPicker) PickStyle(app string, service string) lipgloss.Style

type GithubSource added in v0.0.33

type GithubSource struct {
	Owner string
	Repo  string
}

type LogCallback

type LogCallback func(log *obsv1.Log)

type LogEntry

type LogEntry struct {
	Msg             string
	AgentIdentifier string
	Service         string
	Application     string
	Kind            string
	DebugMe         bool
}

type LogMessage

type LogMessage struct {
	Level     string    `json:"@level"`
	Timestamp time.Time `json:"@timestamp"`

	RawMessage string `json:"@message"`

	Message LogMessageContent
}

type LogMessageContent

type LogMessageContent struct {
	Msg             string `json:"Msg"`
	Application     string `json:"Application"`
	Service         string `json:"Service"`
	Kind            string `json:"Kind"`
	AgentIdentifier string `json:"AgentIdentifier"`
	Level           string `json:"Level"`
}

type Pluggable

type Pluggable interface {
	ImplementationKind() string
	Path() (string, error)
	Name() string
	Unique() string
}

type ServerFormatter

type ServerFormatter struct {
	// contains filtered or unexported fields
}

func NewServerFormatter

func NewServerFormatter(debug bool) *ServerFormatter

func (*ServerFormatter) Write

func (out *ServerFormatter) Write(p []byte) (n int, err error)

type ServiceLogger

type ServiceLogger struct {
	AgentIdentifier string
	Service         string
	Application     string
	JSON            bool
	// contains filtered or unexported fields
}

func NewServiceLogger

func NewServiceLogger(identity *basev1.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) Errorf

func (l *ServiceLogger) Errorf(format string, args ...any) error

func (*ServiceLogger) Info

func (l *ServiceLogger) Info(format string, args ...any)

func (*ServiceLogger) Oops added in v0.0.51

func (l *ServiceLogger) Oops(format string, args ...any)

func (*ServiceLogger) SetLevel

func (*ServiceLogger) SetLogMethod added in v0.0.51

func (l *ServiceLogger) SetLogMethod(actions shared.LogMode) shared.BaseLogger

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)

func (*ServiceLogger) Warn added in v0.0.51

func (l *ServiceLogger) Warn(format string, args ...any)

func (*ServiceLogger) WarnOnError added in v0.0.51

func (l *ServiceLogger) WarnOnError(err error)

func (*ServiceLogger) With added in v0.0.51

func (l *ServiceLogger) With(format string, args ...any) shared.BaseLogger

func (*ServiceLogger) Wrap added in v0.0.51

func (l *ServiceLogger) Wrap(err error) error

func (*ServiceLogger) Wrapf

func (l *ServiceLogger) Wrapf(err error, format string, args ...any) error

func (*ServiceLogger) Write

func (l *ServiceLogger) Write(p []byte) (n int, err error)

Directories

Path Synopsis
helpers
api
go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL