models

package
v3.2.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DatetimeFormat = `2006-01-02 15:04:05`
)

Variables

View Source
var DataCache []*Member
View Source
var DataCacheFile = `cache.data`
View Source
var DataStore []*MemberStore
View Source
var LocalIp string
View Source
var LocalPort string
View Source
var MonitorUrl string
View Source
var TokenCache = make(map[string]string)
View Source
var TokenCacheFile = `token.data`

Functions

func CleanTimeoutData

func CleanTimeoutData(timeout int64)

func InitMonitorUrl

func InitMonitorUrl(url, port string)

func LoadCacheData

func LoadCacheData(dataDir string)

func SaveCacheData

func SaveCacheData()

Types

type Member

type Member struct {
	Id         int
	Name       string
	Token      string
	Metrics    []*MetricObj
	LastUpdate time.Time
	Lock       sync.RWMutex
	Active     bool
}

type MemberStore

type MemberStore struct {
	Id         int
	Name       string
	Token      string
	Metrics    []MetricObj
	LastUpdate time.Time
	Active     bool
}

type MetricObj

type MetricObj struct {
	Id            string
	Metric        string
	Value         float64
	InterfaceName string
	Object        string
	AttrName      string
	HostIp        string
	LastUpdate    time.Time
	Active        bool
}

type RequestMetricData

type RequestMetricData struct {
	SubSystemId      int         `json:"subSystemId" form:"subSystemId" binding:"required"`
	InterfaceName    string      `json:"interfaceName" form:"interfaceName" binding:"required"`
	AttrName         string      `json:"attrName" form:"attrName" binding:"required"`
	CollectTimestamp int64       `json:"collectTimestamp" form:"collectTimestamp"`
	MetricValue      interface{} `json:"metricValue" form:"metricValue" binding:"required"`
	HostIp           string      `json:"hostIp" form:"hostIp" binding:"required"`
	Object           interface{} `json:"object" form:"object"`
}

type TransGatewayRequestDto

type TransGatewayRequestDto struct {
	Name    string `json:"name"`
	HostIp  string `json:"host_ip"`
	Address string `json:"address"`
}

type TransRequest

type TransRequest struct {
	UserAuthKey    string               `json:"userAuthKey" form:"userAuthKey" binding:"required"`
	MetricDataList []*RequestMetricData `json:"metricDataList"`
}

type TransResult

type TransResult struct {
	ResultCode int    `json:"resultCode"`
	ResultMsg  string `json:"resultMsg"`
	SystemTime string `json:"systemTime"`
}

Jump to

Keyboard shortcuts

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