models

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoRecord error.
	ErrNoRecord = errors.New("models: no matching record found")
)

Functions

This section is empty.

Types

type Alarm added in v1.4.0

type Alarm struct {
	CPU    float64 `redis:"cpu"`
	Memory float64 `redis:"memory"`
	Disk   float64 `redis:"disk"`
}

Alarm type.

type AlarmRepository added in v1.4.0

type AlarmRepository interface {
	Find(Probe) (*Alarm, error)
}

AlarmRepository type.

type Probe added in v1.5.0

type Probe string

Probe type.

type ProbeRepository added in v1.5.0

type ProbeRepository interface {
	FindAll() ([]Probe, error)
}

ProbeRepository type.

type RedisAlarmRepository added in v1.4.0

type RedisAlarmRepository struct {
	RedisPool *redis.Pool
}

RedisAlarmRepository type.

func (*RedisAlarmRepository) Find added in v1.4.0

func (rar *RedisAlarmRepository) Find(probe Probe) (*Alarm, error)

Find function.

type RedisProbeRepository added in v1.5.0

type RedisProbeRepository struct {
	RedisPool *redis.Pool
}

RedisProbeRepository type.

func (*RedisProbeRepository) FindAll added in v1.5.0

func (rpr *RedisProbeRepository) FindAll() ([]Probe, error)

FindAll function.

type RedisSeriesRepository

type RedisSeriesRepository struct {
	RedisPool *redis.Pool
}

RedisSeriesRepository type.

func (*RedisSeriesRepository) FindCPU

func (rsr *RedisSeriesRepository) FindCPU(probe Probe, seriesType SeriesType) (Series, Series, Series, error)

FindCPU function.

func (*RedisSeriesRepository) FindDisk

func (rsr *RedisSeriesRepository) FindDisk(probe Probe, seriesType SeriesType, path string) (Series, Series, Series, error)

FindDisk function.

func (*RedisSeriesRepository) FindDiskPaths

func (rsr *RedisSeriesRepository) FindDiskPaths(probe Probe) ([]string, error)

FindDiskPaths function.

func (*RedisSeriesRepository) FindMemory

func (rsr *RedisSeriesRepository) FindMemory(probe Probe, seriesType SeriesType) (Series, Series, Series, error)

FindMemory function.

type Series

type Series []Value

Series type.

type SeriesRepository

type SeriesRepository interface {
	FindCPU(Probe, SeriesType) (Series, Series, Series, error)
	FindMemory(Probe, SeriesType) (Series, Series, Series, error)
	FindDisk(Probe, SeriesType, string) (Series, Series, Series, error)
	FindDiskPaths(Probe) ([]string, error)
}

SeriesRepository type.

type SeriesType

type SeriesType string

SeriesType type.

const (
	// Day series.
	Day SeriesType = "day"

	// Week series.
	Week SeriesType = "week"

	// Month series.
	Month SeriesType = "month"
)

type Value

type Value struct {
	X int64   `json:"x"`
	Y float64 `json:"y"`
}

Value type.

Jump to

Keyboard shortcuts

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