models

package
v0.0.0-...-d202421 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package containing struct definitions for holding configs and params used in vision

Package containing struct definitions for holding configs and params used in vision

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPULoadAvgMetrics

type CPULoadAvgMetrics struct {
	Load1  float64
	Load5  float64
	Load15 float64
}

type CPUMetrics

type CPUMetrics struct {
	LoadAvg CPULoadAvgMetrics
}

type ConfigModel

type ConfigModel struct {
	Port     int64    `json:"port"`
	AllowAll bool     `json:"allow_all"`
	BlockFor []string `json:"block_for"`
	AllowFor []string `json:"allow_for"`
	Aliases  []alias  `json:"aliases"`
}

Struct for holding the config json declared in config file

type HostInfo

type HostInfo struct {
	HostInfo     host.InfoStat
	Timestamp    int64
	TimestampUTC string
}

type ListSystemdResponseHolder

type ListSystemdResponseHolder struct {
	Services     []SystemdHolder
	NumServices  int
	Timestamp    int64
	TimestampUTC string
}

type MemoryMetrics

type MemoryMetrics struct {
	VirtualMemory VirtualMemoryMetrics
}

type OperateSytemdResponseHolder

type OperateSytemdResponseHolder struct {
	Status       string
	Timestamp    int64
	TimestampUTC string
}

type ProcDescriptionLong

type ProcDescriptionLong struct {
	Pid        int32
	Ppid       int32
	Name       string
	CmdLine    string
	ExePath    string
	Cwd        string
	Status     string
	Uids       []int32
	Gids       []int32
	Nice       int32
	NumThreads int32
}

type ProcDescriptionResponse

type ProcDescriptionResponse struct {
	ProcDesc     ProcDescriptionLong
	Timestamp    int64
	TimestampUTC string
}

type ProcDescriptionShort

type ProcDescriptionShort struct {
	Pid     int32
	Name    string
	CmdLine string
}

func (*ProcDescriptionShort) Filter

func (p *ProcDescriptionShort) Filter(filterBy, regex string) (bool, error)

type ProcListResponse

type ProcListResponse struct {
	ProcList     []ProcDescriptionShort
	Timestamp    int64
	TimestampUTC string
}

type QueryHolder

type QueryHolder struct {
	// path to the file
	Path string

	// alias name for a file. must be configured
	Alias string

	// can accept only two values : head or tail
	ReadFrom string

	// number of lines to be streamed
	Limit int64

	// search for lines containing entities matching given regex
	Regex string

	// search for lines containing entities which does not match given regex
	NegateRegex string

	// grep command options
	Grep string
}

func (*QueryHolder) Sanitise

func (queryHolder *QueryHolder) Sanitise(aliases map[string]string) (bool, error)

Function to sanitise the URL query params Params:

aliases : alias map

type SystemMetrics

type SystemMetrics struct {

	// type of system metric wanted : can be cpu, memory as of now
	CPU    CPUMetrics
	Memory MemoryMetrics
}

type SystemMetricsResponse

type SystemMetricsResponse struct {
	Metrics      SystemMetrics
	Timestamp    int64
	TimestampUTC string
}

type SystemdHolder

type SystemdHolder struct {
	ServiceName  string
	ServiceState string
}

type VirtualMemoryMetrics

type VirtualMemoryMetrics struct {
	MemTotal    uint64
	MemFree     uint64
	UsedPercent float64
}

Jump to

Keyboard shortcuts

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