models

package
v0.0.0-...-720764a Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyLogLine = NewError("empty log line after cleaning")
)

Functions

func CleanContainerName

func CleanContainerName(containerName string) string

func EnrichLogWithContainer

func EnrichLogWithContainer(logLine, containerName string) string

func ParseLogLine

func ParseLogLine(line string, maxLength int) (string, error)

func SafeContainerID

func SafeContainerID(id string) string

Types

type Container

type Container struct {
	ID      string            `json:"id"`
	Name    string            `json:"name"`
	Image   string            `json:"image"`
	Status  string            `json:"status"`
	State   string            `json:"state"`
	Created time.Time         `json:"created"`
	Labels  map[string]string `json:"labels"`
}

type ContainerEvent

type ContainerEvent struct {
	ID          string            `json:"id"`
	ContainerID string            `json:"container_id"`
	Action      string            `json:"action"` // start, stop, die, etc.
	Timestamp   time.Time         `json:"timestamp"`
	Attributes  map[string]string `json:"attributes,omitempty"`
}

type ContainerFilter

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

func NewContainerFilter

func NewContainerFilter(rules []FilterRule) *ContainerFilter

func (*ContainerFilter) ShouldCollect

func (f *ContainerFilter) ShouldCollect(container Container) bool

type DataRetention

type DataRetention struct {
	Retention int `json:"retention"`
}

type Error

type Error struct {
	Message string
}

func NewError

func NewError(msg string) *Error

func (*Error) Error

func (e *Error) Error() string

type FilterRule

type FilterRule struct {
	Type    string `yaml:"type"`    // image, label, name
	Pattern string `yaml:"pattern"` // regex pattern o string exacto
	Action  string `yaml:"action"`  // include, exclude
}

type Log

type Log struct {
	ID         string `gorm:"index"`
	CreatedAt  time.Time
	DataSource string
	Type       string
	Log        string
	Processed  bool
}

type LogEntry

type LogEntry struct {
	ID            string `json:"id"`
	ContainerID   string `json:"container_id"`
	ContainerName string `json:"container_name"`
	Message       string `json:"message"`
}

type Version

type Version struct {
	Version string `json:"version"`
}

Jump to

Keyboard shortcuts

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