output

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventType

type EventType string
const (
	EventTypeAdd    EventType = "add"
	EventTypeUpdate EventType = "update"
	EventTypeDelete EventType = "delete"
)

type Events

type Events struct {
	gormutils.ModelUnscoped

	Cluster   string    `json:"cluster" gorm:"type:varchar(64);index"`
	EventTime time.Time `json:"event_time" gorm:"index"`
	Source    string    `json:"source" gorm:"type:varchar(64);index"`
	EventType string    `json:"event_type" gorm:"type:varchar(64);index"`

	APIVersion string `json:"api_version" gorm:"type:varchar(64);index"`
	Kind       string `json:"kind" gorm:"type:varchar(64);index"`
	Namespace  string `json:"namespace" gorm:"type:varchar(64);index"`
	Name       string `json:"name" gorm:"type:varchar(64);index"`
	UID        string `json:"uid" gorm:"type:varchar(64);index"`

	Fields  datatypes.JSON `json:"fields"`
	Message string         `json:"message" gorm:"type:text"`

	Object    datatypes.JSON `json:"object"`
	Diff      string         `json:"diff" gorm:"type:text"`
	JsonPatch datatypes.JSON `json:"json_patch"`
}

type LogOutput

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

func NewLogOutput

func NewLogOutput(conf *config.OutputLog) *LogOutput

func (*LogOutput) Name

func (lo *LogOutput) Name() string

func (*LogOutput) Write

func (lo *LogOutput) Write(out OutputStruct) error

type MysqlOutput

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

func NewMysqlOutput

func NewMysqlOutput(ktconfig *config.KubeTrackConfiguration, conf *config.OutputMysql) *MysqlOutput

func (*MysqlOutput) Name

func (lo *MysqlOutput) Name() string

func (*MysqlOutput) Write

func (lo *MysqlOutput) Write(out OutputStruct) error

type Output

type Output interface {
	Name() string
	Write(out OutputStruct) error
}

type OutputStruct

type OutputStruct struct {
	EventTime time.Time `json:"event_time"`

	ObjectRef corev1.ObjectReference

	EventType EventType      `json:"event_type"`
	Source    SourceType     `json:"source"`
	Object    map[string]any `json:"object"`
	Diff      string         `json:"diff"`
	JsonPatch string         `json:"json_patch"`
	Fields    map[string]any `json:"fields"`
	Message   string         `json:"message"` // event message
}

type PostgresOutput

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

func NewPostgresOutput

func NewPostgresOutput(ktconfig *config.KubeTrackConfiguration, conf *config.OutputPostgres) *PostgresOutput

func (*PostgresOutput) Name

func (lo *PostgresOutput) Name() string

func (*PostgresOutput) Write

func (lo *PostgresOutput) Write(out OutputStruct) error

type SourceType

type SourceType string
const (
	SourceTypeGeneral   SourceType = "general"
	SourceTypeEvent     SourceType = "event"
	SourceTypeKubetrack SourceType = "kubetrack"
)

Jump to

Keyboard shortcuts

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