logStore

package
v0.2.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AUDIT_TYPE = "audit"
	EVENT_TYPE = "event"
	POD_TYPE   = "pod"
	NODE_TYPE  = "node"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventSearchParams

type EventSearchParams struct {
	Namespace string
	Type      string
	Reason    string
	Object    string
	Count     string
}

type LogLine

type LogLine interface {
	GetName() string

	CompactRaw() string
	// contains filtered or unexported methods
}

type LogSearch

type LogSearch struct {
	LogType       LogLine         // audit | event | pod | node
	TargetPattern PatternedString // audit | event | <namespace_pattern> | <node_pattern>
	Targets       []string
	// AuditSearchParams AuditSearchParams
	EventSearchParams EventSearchParams
	PodSearchParams   PodSearchParams
	NodeSearchParams  NodeSearchParams
	Keyword           string
	DurationSeconds   int
	EndTime           time.Time
	StartTime         time.Time
	IsCounting        bool
	Filter            filter.Filter
}

type LogStore

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

func New

func New() *LogStore

func (*LogStore) GetLogs

func (ls *LogStore) GetLogs(logSearch LogSearch) (Result, error)

type NodeLog

type NodeLog struct {
	Name    string `json:"-"`
	Time    string `json:"time,omitempty"`
	Node    string `json:"node,omitempty"`
	Process string `json:"process,omitempty"`
	Log     string `json:"log,omitempty"`
}

func (NodeLog) CompactRaw

func (log NodeLog) CompactRaw() string

func (NodeLog) GetName

func (log NodeLog) GetName() string

type NodeSearchParams

type NodeSearchParams struct {
	Nodes   []string
	Node    PatternedString
	Process PatternedString
}

type Patternable

type Patternable interface {
	Patterned() bool
}

now Patternable can handle only one '*' and starts with substring exampel) nignx-*, namespace*,

type PatternedString

type PatternedString string

func (PatternedString) PatternMatch

func (ps PatternedString) PatternMatch(s string) bool

func (PatternedString) Patterned

func (ps PatternedString) Patterned() bool

type PodLog

type PodLog struct {
	Name      string `json:"-"`
	Time      string `json:"time"`
	Namespace string `json:"namespace"`
	Pod       string `json:"pod"`
	Container string `json:"container"`
	Log       string `json:"log"`
}

func (PodLog) CompactRaw

func (log PodLog) CompactRaw() string

func (PodLog) GetName

func (log PodLog) GetName() string

type PodSearchParams

type PodSearchParams struct {
	Namespaces []string
	Namespace  PatternedString
	Pod        PatternedString
	Container  PatternedString
}

type Result

type Result struct {
	IsCounting bool
	Logs       []LogLine
	Count      int
}

Jump to

Keyboard shortcuts

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