types

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GroupStatusNotReceiving = iota
	GroupStatusReceiving    = iota
)
View Source
const (
	UpdateTypePassthru = iota
	UpdateTypeInterval = iota
	UpdateTypeDeadband = iota
	UpdateTypeDevNull  = iota
)

Variables

This section is empty.

Functions

func CreateSlice

func CreateSlice(name string) interface{}

func CreateType

func CreateType(name string) interface{}

func RegisterType

func RegisterType(name string, datatype interface{})

Types

type Context added in v0.2.2

type Context struct {
	Cmd     string
	Wdir    string
	Trace   bool
	Version bool
}

Process context variables

type DataMessage

type DataMessage struct {
	Version  int         `json:"version"`
	Group    string      `json:"group"`
	Interval int         `json:"interval"`
	Sequence uint64      `json:"sequence"`
	Count    int         `json:"count"`
	Points   []DataPoint `json:"points"`
}

type DataPoint

type DataPoint struct {
	ID      int         `json:"id"`
	Time    time.Time   `json:"t"`
	Name    string      `json:"n"`
	Value   interface{} `json:"v"`
	Quality int         `json:"q"`
}

Version 2 message types

type DataPointMeta

type DataPointMeta struct {
	ID                  uint    `json:"id" gorm:"autoincrement"`
	Name                string  `json:"name" gorm:"unique;index"`
	Description         string  `json:"description"`
	EngUnit             string  `json:"engunit"`
	MinValue            float64 `json:"min"`
	MaxValue            float64 `json:"max"`
	Quantity            string  `json:"quantity"`
	UpdateType          int     `json:"updatetype"` // 0 = pass thru, 1 = interval, 2 = integrating deadband, 3 = disabled
	Interval            int     `json:"interval"`
	IntegratingDeadband float64 `json:"integratingdeadband"`
	Alias               string  `json:"alias"`
}

type Emitter

type Emitter struct {
	gorm.Model
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Type        string    `json:"type"`
	Settings    string    `json:"settings"`
	Instance    IEmitter  `json:"instance" gorm:"-"`
	Count       uint64    `json:"count"`
	LastRun     time.Time `json:"lastrun"`
	Status      int       `json:"status"` // 0 = stopped, 1 = running
}

type EmitterStatistics

type EmitterStatistics struct {
	TotalCount uint64 `json:"totalcount"`
}

type IEmitter

type IEmitter interface {
	InitEmitter() error
	ProcessMessage(msg *DataPoint)
	ProcessMeta(msg *DataPointMeta)
	GetStats() *EmitterStatistics
}

type IListener

type IListener interface {
	InitListener(ctx *Context) error
}

type KeyValuePair

type KeyValuePair struct {
	gorm.Model
	Key   string `json:"key"`
	Value string `json:"value"`
	Extra string `json:"extra"`
}

type Listener

type Listener struct {
	gorm.Model
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Type        string    `json:"type"`
	Settings    string    `json:"settings"`
	Instance    IListener `json:"instance" gorm:"-"`
}

type ListenerStatistics

type ListenerStatistics struct {
	TotalCount uint64 `json:"totalcount"`
}

type Log

type Log struct {
	gorm.Model
	Time        time.Time `json:"time"`
	Source      string    `json:"source"`
	Category    string    `json:"category"`
	Title       string    `json:"title"`
	Description string    `json:"description"`
}

type Meta

type Meta struct {
	TagId       int     `json:"tag_id"`
	Name        string  `json:"name"`
	Description string  `json:"description"`
	Location    string  `json:"location"`
	Type        string  `json:"type"`
	Unit        string  `json:"unit"`
	Min         float64 `json:"min"`
	Max         float64 `json:"max"`
}

Imported meta data

type Recipient

type Recipient struct {
	gorm.Model
	Email    string `json:"email"`
	Category string `json:"category"`
}

type Settings

type Settings struct {
	gorm.Model
	Dark     bool   `json:"dark"`
	ImageURL string `json:"imageurl"`
}

type User

type User struct {
	gorm.Model
	UserName   string   `form:"email" json:"email" binding:"required"`
	Password   string   `form:"password" json:"password"`
	FullName   string   `form:"fullname" json:"fullname" binding:"required"`
	Settings   Settings `json:"settings"`
	SettingsID uint     `json:"settingsid"`
}

User

type UserCredentials

type UserCredentials struct {
	gorm.Model
	UserName string `form:"email" json:"email" binding:"required"`
	Password string `form:"password" json:"password" binding:"required"`
}

type UserData

type UserData struct {
	gorm.Model
	UserName   string   `form:"email" json:"email" binding:"required"`
	FullName   string   `form:"fullname" json:"fullname" binding:"required"`
	Settings   Settings `json:"settings"`
	SettingsID uint     `json:"settingsid"`
}

type UserPasswordUpdate

type UserPasswordUpdate struct {
	gorm.Model
	Password string `form:"password" json:"password" binding:"required"`
}

type VolatileDataPoint

type VolatileDataPoint struct {
	DataPoint     *DataPoint    `json:"datapoint"`
	DataPointMeta DataPointMeta `json:"datapointmeta"`
	StoredValue   float64       `json:"storedvalue"` // only used for the integrating deadband (floating data points)
	Integrator    float64       `json:"integrator"`
	Threshold     float64       `json:"threshold"`
	LastEmitted   time.Time     `json:"lastemitted"`
}

Jump to

Keyboard shortcuts

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