models

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerToken    = `default-token-used-in-server-side`
	DatetimeFormat = `2006-01-02 15:04:05`
	Version        = `1.0.0`
)

Variables

View Source
var (
	ConfigFile string
)

Functions

func InitConfig

func InitConfig(cfg string)

Types

type AMRespAlert

type AMRespAlert struct {
	Status       string            `json:"status"`
	Labels       map[string]string `json:"labels"`
	Annotations  map[string]string `json:"annotations"`
	StartsAt     time.Time         `json:"startsAt"`
	EndsAt       time.Time         `json:"endsAt"`
	GeneratorURL string            `json:"generatorURL"`
	Fingerprint  string            `json:"fingerprint"`
}

type AcceptObj

type AcceptObj struct {
	Employ []string `json:"employ"`
}

type AgentConfig added in v1.0.1

type AgentConfig struct {
	AgentType string `json:"agent_type"`
	AgentBin  string `json:"agent_bin"`
	Port      string `json:"port"`
	User      string `json:"user"`
	Password  string `json:"password"`
}

type AlarmEndpointObj

type AlarmEndpointObj struct {
	Id         string `json:"id"`
	Guid       string `json:"guid"`
	Type       string `json:"type"`
	GroupsName string `json:"groups_name"`
}

type AlarmEndpointQuery

type AlarmEndpointQuery struct {
	Search    string
	Page      int
	Size      int
	Grp       int
	Result    []*AlarmEndpointObj
	ResultNum int
}

type AlarmProblemList added in v1.0.1

type AlarmProblemList []*AlarmProblemQuery

func (AlarmProblemList) Len added in v1.0.1

func (s AlarmProblemList) Len() int

func (AlarmProblemList) Less added in v1.0.1

func (s AlarmProblemList) Less(i, j int) bool

func (AlarmProblemList) Swap added in v1.0.1

func (s AlarmProblemList) Swap(i, j int)

type AlarmProblemQuery

type AlarmProblemQuery struct {
	Id           int       `json:"id"`
	StrategyId   int       `json:"strategy_id"`
	Endpoint     string    `json:"endpoint"`
	Status       string    `json:"status"`
	SMetric      string    `json:"s_metric"`
	SExpr        string    `json:"s_expr"`
	SCond        string    `json:"s_cond"`
	SLast        string    `json:"s_last"`
	SPriority    string    `json:"s_priority"`
	Content      string    `json:"content"`
	Tags         string    `json:"tags"`
	StartValue   float64   `json:"start_value"`
	Start        time.Time `json:"start"`
	StartString  string    `json:"start_string"`
	End          time.Time `json:"end"`
	EndString    string    `json:"end_string"`
	IsLogMonitor bool      `json:"is_log_monitor"`
	Path         string    `json:"path"`
	Keyword      string    `json:"keyword"`
	IsCustom     bool      `json:"is_custom"`
}

type AlarmTable

type AlarmTable struct {
	Id         int       `json:"id"`
	StrategyId int       `json:"strategy_id"`
	Endpoint   string    `json:"endpoint"`
	Status     string    `json:"status"`
	SMetric    string    `json:"s_metric"`
	SExpr      string    `json:"s_expr"`
	SCond      string    `json:"s_cond"`
	SLast      string    `json:"s_last"`
	SPriority  string    `json:"s_priority"`
	Content    string    `json:"content"`
	Tags       string    `json:"tags"`
	StartValue float64   `json:"start_value"`
	Start      time.Time `json:"start"`
	EndValue   float64   `json:"end_value"`
	End        time.Time `json:"end"`
}

type AlertConfig added in v1.1.0

type AlertConfig struct {
	Enable bool            `json:"enable"`
	Mail   AlertMailConfig `json:"mail"`
}

type AlertMailConfig added in v1.1.0

type AlertMailConfig struct {
	Enable   bool   `json:"enable"`
	Protocol string `json:"protocol"`
	Sender   string `json:"sender"`
	User     string `json:"user"`
	Password string `json:"password"`
	Server   string `json:"server"`
	Token    string `json:"token"`
}

type AlterManagerRespObj

type AlterManagerRespObj struct {
	Receiver          string            `json:"receiver"`
	Status            string            `json:"status"`
	Alerts            []AMRespAlert     `json:"alerts"`
	GroupLabels       map[string]string `json:"groupLabels"`
	CommonLabels      map[string]string `json:"commonLabels"`
	CommonAnnotations map[string]string `json:"commonAnnotations"`
	ExternalURL       string            `json:"externalURL"`
	Version           string            `json:"version"`
	GroupKey          string            `json:"groupKey"`
}

type BusinessMonitorTable added in v1.0.1

type BusinessMonitorTable struct {
	Id         int    `json:"id"`
	EndpointId int    `json:"endpoint_id"`
	Path       string `json:"path"`
}

type BusinessUpdateDto added in v1.0.1

type BusinessUpdateDto struct {
	EndpointId int      `json:"endpoint_id" binding:"required"`
	PathList   []string `json:"path_list"`
}

type ButtonModel

type ButtonModel struct {
	Id               int            `json:"id"`
	GroupId          int            `json:"group_id"`
	Name             string         `json:"name"`
	BType            string         `json:"b_type"`
	BText            string         `json:"b_text"`
	RefreshPanels    bool           `json:"refresh_panels"`
	RefreshCharts    bool           `json:"refresh_charts"`
	OptionGroup      int            `json:"option_group"`
	RefreshButton    int            `json:"refresh_button"`
	RefreshButtonUrl string         `json:"refresh_button_url"`
	Options          []*OptionModel `json:"option"`
}

type Chart

type Chart struct {
	Endpoint []string     `json:"endpoint"`
	Metric   []string     `json:"metric"`
	Option   EChartOption `json:"option"`
}

type ChartConfigObj

type ChartConfigObj struct {
	Id        int    `form:"id" json:"id"`
	Endpoint  string `form:"endpoint" json:"endpoint"`
	Metric    string `form:"metric" json:"metric"`
	PromQl    string `form:"prom_ql" json:"prom_ql"`
	Start     string `form:"start" json:"start"`
	End       string `form:"end" json:"end"`
	Time      string `form:"time" json:"time"`
	Aggregate string `form:"aggregate" json:"aggregate"`
}

type ChartModel

type ChartModel struct {
	Id        int      `json:"id"`
	Col       int      `json:"col"`
	Endpoint  []string `json:"endpoint"`
	Metric    []string `json:"metric"`
	Url       string   `json:"url"`
	Aggregate string   `json:"aggregate"`
}

type ChartTable

type ChartTable struct {
	Id         int    `json:"id"`
	GroupId    int    `json:"group_id"`
	Endpoint   string `json:"endpoint"`
	Metric     string `json:"metric"`
	Col        int    `json:"col"`
	Url        string `json:"url"`
	Unit       string `json:"unit"`
	Title      string `json:"title"`
	GridType   string `json:"grid_type"`
	SeriesName string `json:"series_name"`
	Rate       bool   `json:"rate"`
	AggType    string `json:"agg_type"`
	Legend     string `json:"legend"`
}

type CustomDashboardTable

type CustomDashboardTable struct {
	Id          int       `json:"id"`
	Name        string    `json:"name"`
	PanelsGroup int       `json:"panels_group"`
	Cfg         string    `json:"cfg"`
	Main        int       `json:"main"`
	CreateUser  string    `json:"create_user"`
	UpdateUser  string    `json:"update_user"`
	CreateAt    time.Time `json:"create_at"`
	UpdateAt    time.Time `json:"update_at"`
}

type Dashboard

type Dashboard struct {
	Search  SearchModel    `json:"search"`
	Buttons []*ButtonModel `json:"buttons"`
	Message MessageModel   `json:"message"`
	Panels  PanelsModel    `json:"panels"`
}

type DashboardTable

type DashboardTable struct {
	Id            int    `json:"id"`
	DashboardType string `json:"dashboard_type"`
	SearchEnable  bool   `json:"search_enable"`
	SearchId      int    `json:"search_id"`
	ButtonEnable  bool   `json:"button_enable"`
	ButtonGroup   int    `json:"button_group"`
	MessageEnable bool   `json:"message_enable"`
	MessageGroup  int    `json:"message_group"`
	MessageUrl    string `json:"message_url"`
	PanelsEnable  bool   `json:"panels_enable"`
	PanelsType    string `json:"panels_type"`
	PanelsGroup   int    `json:"panels_group"`
	PanelsParam   string `json:"panels_param"`
}

type DataSort

type DataSort [][]float64

func (DataSort) Len

func (s DataSort) Len() int

func (DataSort) Less

func (s DataSort) Less(i, j int) bool

func (DataSort) Swap

func (s DataSort) Swap(i, j int)

type DataSourceConfig

type DataSourceConfig struct {
	Env        string               `json:"env"`
	Servers    []*DatasourceServers `json:"servers"`
	DivideTime int64                `json:"divide_time"`
	WaitTime   int                  `json:"wait_time"`
}

type DatasourceServers

type DatasourceServers struct {
	Id    int    `json:"id"`
	Type  string `json:"type"`
	Env   string `json:"env"`
	Host  string `json:"host"`
	Token string `json:"token"`
}

type DependenceConfig

type DependenceConfig struct {
	Name     string `json:"name"`
	Server   string `json:"server"`
	Username string `json:"username"`
	Password string `json:"password"`
	Expire   int    `json:"expire"`
}

type EChartOption

type EChartOption struct {
	Id     int            `json:"id"`
	Title  string         `json:"title"`
	Legend []string       `json:"legend"`
	Xaxis  interface{}    `json:"xaxis"`
	Yaxis  YaxisModel     `json:"yaxis"`
	Series []*SerialModel `json:"series"`
}

type EndpointMetricTable

type EndpointMetricTable struct {
	Id         int    `json:"id"`
	EndpointId int    `json:"endpoint_id"`
	Metric     string `json:"metric"`
}

type EndpointTable

type EndpointTable struct {
	Id              int    `json:"id"`
	Guid            string `json:"guid"`
	Name            string `json:"name"`
	Ip              string `json:"ip"`
	EndpointVersion string `json:"endpoint_version"`
	ExportType      string `json:"export_type"`
	ExportVersion   string `json:"export_version"`
	Step            int    `json:"step"`
	Address         string `json:"address"`
	OsType          string `json:"os_type"`
	CreateAt        string `json:"create_at"`
	StopAlarm       int    `json:"stop_alarm"`
	AddressAgent    string `json:"address_agent"`
}

type GlobalConfig

type GlobalConfig struct {
	Http         *HttpConfig         `json:"http"`
	Store        StoreConfig         `json:"store"`
	Datasource   DataSourceConfig    `json:"datasource"`
	LimitIp      []string            `json:"limitIp"`
	Dependence   []*DependenceConfig `json:"dependence"`
	Prometheus   PrometheusConfig    `json:"prometheus"`
	TagBlacklist []string            `json:"tag_blacklist"`
	Agent        []*AgentConfig      `json:"agent"`
	Alert        AlertConfig         `json:"alert"`
}

func Config

func Config() *GlobalConfig

type GrpEndpointParam

type GrpEndpointParam struct {
	Grp       int      `json:"grp" binding:"required"`
	Endpoints []string `json:"endpoints"`
}

type GrpEndpointParamNew

type GrpEndpointParamNew struct {
	Grp       int    `json:"grp" binding:"required"`
	Endpoints []int  `json:"endpoints"`
	Operation string `json:"operation" binding:"required"`
}

type GrpEndpointTable

type GrpEndpointTable struct {
	GrpId      int `json:"grp_id"`
	EndpointId int `json:"endpoint_id"`
}

type GrpQuery

type GrpQuery struct {
	Id        int
	Name      string
	Search    string
	User      string
	Page      int
	Size      int
	Result    []*GrpTable
	ResultNum int
}

type GrpStrategyExportObj added in v1.0.1

type GrpStrategyExportObj struct {
	GrpName     string          `json:"grp_name"`
	Description string          `json:"description"`
	Strategy    []StrategyTable `json:"strategy"`
}

type GrpStrategyQuery added in v1.0.1

type GrpStrategyQuery struct {
	Name        string
	Description string
	Metric      string
	Expr        string
	Cond        string
	Last        string
	Priority    string
	Content     string
	ConfigType  string
}

type GrpTable

type GrpTable struct {
	Id          int       `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	CreateUser  string    `json:"create_user"`
	UpdateUser  string    `json:"update_user"`
	CreateAt    time.Time `json:"create_at"`
	UpdateAt    time.Time `json:"update_at"`
}

type HttpConfig

type HttpConfig struct {
	Port        string         `json:"port"`
	Swagger     bool           `json:"swagger"`
	Cross       bool           `json:"cross"`
	ReturnError bool           `json:"return_error"`
	Alive       int64          `json:"alive"`
	Ldap        *LdapConfig    `json:"ldap"`
	Log         *LogConfig     `json:"log"`
	Session     *SessionConfig `json:"session"`
}

type LdapConfig

type LdapConfig struct {
	Enable     bool     `json:"enable"`
	Server     string   `json:"server"`
	Port       int      `json:"port"`
	BindDN     string   `json:"bindDN"`
	BaseDN     string   `json:"baseDN"`
	Filter     string   `json:"filter"`
	Attributes []string `json:"attributes"`
}

type LogConfig

type LogConfig struct {
	Enable bool   `json:"enable"`
	Level  string `json:"level"`
	File   string `json:"file"`
	Stdout bool   `json:"stdout"`
}

type LogMonitorDto

type LogMonitorDto struct {
	Id         int                      `json:"id"`
	TplId      int                      `json:"tpl_id"`
	GrpId      int                      `json:"grp_id"`
	EndpointId int                      `json:"endpoint_id"`
	Path       string                   `json:"path" binding:"required"`
	Strategy   []*LogMonitorStrategyDto `json:"strategy"`
}

type LogMonitorStrategyDto

type LogMonitorStrategyDto struct {
	Id         int    `json:"id"`
	StrategyId int    `json:"strategy_id"`
	Keyword    string `json:"keyword"`
	Cond       string `json:"cond"`
	Last       string `json:"last"`
	Priority   string `json:"priority"`
}

type LogMonitorTable

type LogMonitorTable struct {
	Id         int    `json:"id"`
	StrategyId int    `json:"strategy_id"`
	Path       string `json:"path"`
	Keyword    string `json:"keyword"`
}

type MaintainDto

type MaintainDto struct {
	Start         int64  `json:"start"`
	End           int64  `json:"end"`
	Endpoint      string `json:"endpoint"`
	Ip            string `json:"ip"`
	EndpointType  string `json:"endpoint_type"`
	ClearMaintain bool   `json:"clear_maintain"`
}

type MaintainTable

type MaintainTable struct {
	Id            int       `json:"id"`
	EndpointId    int       `json:"endpoint_id"`
	MaintainStart time.Time `json:"maintain_start"`
	MaintainEnd   time.Time `json:"maintain_end"`
	MaintainUser  string    `json:"maintain_user"`
}

type MessageModel

type MessageModel struct {
	Enable bool   `json:"enable"`
	Url    string `json:"url"`
}

type MessageTable

type MessageTable struct {
	Id      int    `json:"id"`
	GroupId int    `json:"group_id"`
	K       string `json:"k"`
	Rename  string `json:"rename"`
	Col     string `json:"col"`
	Href    bool   `json:"href"`
	Url     string `json:"url"`
}

type OpenAlarmObj added in v1.0.1

type OpenAlarmObj struct {
	Id           int       `json:"id"`
	AlertInfo    string    `json:"alert_info"`
	AlertIp      string    `json:"alert_ip"`
	AlertLevel   int       `json:"alert_level"`
	AlertObj     string    `json:"alert_obj"`
	AlertTitle   string    `json:"alert_title"`
	AlertReciver string    `json:"alert_reciver"`
	RemarkInfo   string    `json:"remark_info"`
	SubSystemId  int       `json:"sub_system_id"`
	UpdateAt     time.Time `json:"update_at"`
}

type OpenAlarmRequest added in v1.0.1

type OpenAlarmRequest struct {
	AlertList []OpenAlarmObj `json:"alertList"`
}

type OpenAlarmResponse added in v1.0.1

type OpenAlarmResponse struct {
	ResultCode int    `json:"resultCode"`
	ResultMsg  string `json:"resultMsg"`
}

type OptionModel

type OptionModel struct {
	Id          int    `json:"id"`
	OptionValue string `json:"option_value"`
	OptionText  string `json:"option_text"`
	Active      bool   `json:"active"`
}

type PanelModel

type PanelModel struct {
	Title  string        `json:"title"`
	Tags   TagsModel     `json:"tags"`
	Other  bool          `json:"other"`
	Charts []*ChartModel `json:"charts"`
}

type PanelRecursiveTable added in v1.1.0

type PanelRecursiveTable struct {
	Guid         string `json:"guid"`
	DisplayName  string `json:"display_name"`
	Children     string `json:"children"`
	Endpoint     string `json:"endpoint"`
	EndpointType string `json:"endpoint_type"`
}

type PanelTable

type PanelTable struct {
	Id         int    `json:"id"`
	GroupId    int    `json:"group_id"`
	Title      string `json:"title"`
	TagsEnable bool   `json:"tags_enable"`
	TagsUrl    string `json:"tags_url"`
	TagsKey    string `json:"tags_key"`
	ChartGroup int    `json:"chart_group"`
}

type PanelTag

type PanelTag struct {
	Col      int      `json:"col"`
	Endpoint []string `json:"endpoint"`
	Metric   []string `json:"metric"`
	Url      string   `json:"url"`
}

type PanelsModel

type PanelsModel struct {
	Enable bool   `json:"enable"`
	Type   string `json:"type"`
	Url    string `json:"url"`
}

type ProcessMonitorTable added in v1.0.1

type ProcessMonitorTable struct {
	Id         int    `json:"id"`
	EndpointId int    `json:"endpoint_id"`
	Name       string `json:"name"`
}

type ProcessUpdateDto added in v1.0.1

type ProcessUpdateDto struct {
	EndpointId  int      `json:"endpoint_id" binding:"required"`
	ProcessList []string `json:"process_list"`
}

type PromMetricTable

type PromMetricTable struct {
	Id         int    `json:"id"`
	Metric     string `json:"metric" binding:"required"`
	MetricType string `json:"metric_type"`
	PromQl     string `json:"prom_ql" binding:"required"`
	PromMain   string `json:"prom_main"`
}

type PrometheusConfig

type PrometheusConfig struct {
	ConfigPath   string `json:"config_path"`
	ConfigReload string `json:"config_reload"`
}

type PrometheusData

type PrometheusData struct {
	Result     []PrometheusResult `json:"result"`
	ResultType string             `json:"resultType"`
}

type PrometheusParam

type PrometheusParam struct {
	Start int64  `json:"start"`
	End   int64  `json:"end"`
	Step  int64  `json:"step"`
	Query string `json:"query"`
}

type PrometheusResponse

type PrometheusResponse struct {
	Status string         `json:"status"`
	Data   PrometheusData `json:"data"`
}

type PrometheusResult

type PrometheusResult struct {
	Metric map[string]string `json:"metric"`
	Values [][]interface{}   `json:"values"`
}

type QueryMonitorData

type QueryMonitorData struct {
	Start    int64    `json:"start"`
	End      int64    `json:"end"`
	Endpoint []string `json:"endpoint"`
	Metric   []string `json:"metric"`
	PromQ    string   `json:"prom_q"`
	Legend   string   `json:"legend"`
}

type RFAnnotation

type RFAnnotation struct {
	Summary     string `yaml:"summary"`
	Description string `yaml:"description"`
}

type RFGroup

type RFGroup struct {
	Name  string    `yaml:"name"`
	Rules []*RFRule `yaml:"rules"`
}

RF -> RuleFile

type RFRule

type RFRule struct {
	Alert       string            `yaml:"alert"`
	Expr        string            `yaml:"expr"`
	For         string            `yaml:"for"`
	Labels      map[string]string `yaml:"labels"`
	Annotations RFAnnotation      `yaml:"annotations"`
}

type RegisterConsulCheck

type RegisterConsulCheck struct {
	Http     string `json:"http"`
	Interval string `json:"interval"`
}

type RegisterConsulParam

type RegisterConsulParam struct {
	Id      string                 `json:"id"`
	Name    string                 `json:"name"`
	Address string                 `json:"address"`
	Port    int                    `json:"port"`
	Tags    []string               `json:"tags"`
	Checks  []*RegisterConsulCheck `json:"checks"`
}

type RegisterParam

type RegisterParam struct {
	Type         string `json:"type" form:"type" binding:"required"`
	ExporterIp   string `json:"exporter_ip" form:"exporter_ip" binding:"required"`
	ExporterPort string `json:"exporter_port" form:"exporter_port" binding:"required"`
	Instance     string `json:"instance" form:"instance"`
	User         string `json:"user"`
	Password     string `json:"password"`
}

type RelRoleUserTable added in v1.1.0

type RelRoleUserTable struct {
	Id     int `json:"id"`
	RoleId int `json:"role_id"`
	UserId int `json:"user_id"`
}

type RoleQuery added in v1.1.0

type RoleQuery struct {
	Id            int       `json:"id"`
	Name          string    `json:"name"`
	DisplayName   string    `json:"display_name"`
	Email         string    `json:"email"`
	Creator       string    `json:"creator"`
	Created       time.Time `json:"created"`
	CreatedString string    `json:"created_string"`
}

type RoleTable added in v1.0.1

type RoleTable struct {
	Id          int       `json:"id"`
	Name        string    `json:"name"`
	DisplayName string    `json:"display_name"`
	Email       string    `json:"email"`
	Parent      int       `json:"parent"`
	Creator     string    `json:"creator"`
	Created     time.Time `json:"created"`
}

type RuleFile

type RuleFile struct {
	Groups []*RFGroup `yaml:"groups"`
}

type SearchModel

type SearchModel struct {
	Id             int    `json:"id"`
	Enable         bool   `json:"enable"`
	Name           string `json:"name"`
	SearchUrl      string `json:"search_url"`
	SearchCol      string `json:"search_col"`
	RefreshPanels  bool   `json:"refresh_panels"`
	RefreshMessage bool   `json:"refresh_message"`
}

type SendAlertObj added in v1.1.0

type SendAlertObj struct {
	Accept  []string
	Subject string
	Content string
}

type SerialModel

type SerialModel struct {
	Type string      `json:"type"`
	Name string      `json:"name"`
	Data [][]float64 `json:"data"`
}

type Session

type Session struct {
	User   string `json:"user"`
	Token  string `json:"token"`
	Expire int64  `json:"expire"`
}

type SessionConfig added in v1.0.1

type SessionConfig struct {
	Enable       bool               `json:"enable"`
	Expire       int64              `json:"expire"`
	ServerEnable bool               `json:"server_enable"`
	ServerToken  string             `json:"server_token"`
	Redis        SessionRedisConfig `json:"redis"`
}

type SessionRedisConfig added in v1.0.1

type SessionRedisConfig struct {
	Enable  bool   `json:"enable"`
	Server  string `json:"server"`
	Port    int    `json:"port"`
	Pwd     string `json:"pwd"`
	Db      int    `json:"db"`
	MaxIdle int    `json:"max_idle"`
}

type StoreConfig

type StoreConfig struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Server   string `json:"server"`
	Port     int    `json:"port"`
	User     string `json:"user"`
	Pwd      string `json:"pwd"`
	DataBase string `json:"database"`
	MaxOpen  int    `json:"maxOpen"`
	MaxIdle  int    `json:"maxIdle"`
	Timeout  int    `json:"timeout"`
}

type StrategyTable

type StrategyTable struct {
	Id         int    `json:"id"`
	TplId      int    `json:"tpl_id"`
	Metric     string `json:"metric" binding:"required"`
	Expr       string `json:"expr" binding:"required"`
	Cond       string `json:"cond" binding:"required"`
	Last       string `json:"last" binding:"required"`
	Priority   string `json:"priority" binding:"required"`
	Content    string `json:"content" binding:"required"`
	ConfigType string `json:"config_type"`
}

type TableData

type TableData struct {
	Data interface{} `json:"data"`
	Page int         `json:"page"`
	Size int         `json:"size"`
	Num  int         `json:"num"`
}

type TagsModel

type TagsModel struct {
	Enable bool           `json:"enable"`
	Url    string         `json:"url"`
	Option []*OptionModel `json:"option"`
}

type TplObj

type TplObj struct {
	TplId      int              `json:"tpl_id"`
	ObjId      int              `json:"obj_id"`
	ObjName    string           `json:"obj_name"`
	ObjType    string           `json:"obj_type"`
	Operation  bool             `json:"operation"`
	Accept     []*OptionModel   `json:"accept"`
	Strategy   []*StrategyTable `json:"strategy"`
	LogMonitor []*LogMonitorDto `json:"log_monitor"`
}

type TplQuery

type TplQuery struct {
	SearchType string    `json:"search_type"`
	SearchId   int       `json:"search_id"`
	Tpl        []*TplObj `json:"tpl"`
}

type TplStrategyLogMonitorTable

type TplStrategyLogMonitorTable struct {
	TplId        int    `json:"tpl_id"`
	GrpId        int    `json:"grp_id"`
	LogMonitorId int    `json:"log_monitor_id"`
	EndpointId   int    `json:"endpoint_id"`
	StrategyId   int    `json:"strategy_id"`
	Expr         string `json:"expr" binding:"required"`
	Cond         string `json:"cond" binding:"required"`
	Last         string `json:"last"`
	Priority     string `json:"priority" binding:"required"`
	Path         string `json:"path"`
	Keyword      string `json:"keyword"`
}

type TplStrategyTable

type TplStrategyTable struct {
	TplId      int    `json:"tpl_id"`
	GrpId      int    `json:"grp_id"`
	EndpointId int    `json:"endpoint_id"`
	StrategyId int    `json:"strategy_id"`
	Metric     string `json:"metric" binding:"required"`
	Expr       string `json:"expr" binding:"required"`
	Cond       string `json:"cond" binding:"required"`
	Last       string `json:"last" binding:"required"`
	Priority   string `json:"priority" binding:"required"`
	Content    string `json:"content" binding:"required"`
}

type TplTable

type TplTable struct {
	Id         int       `json:"id"`
	GrpId      int       `json:"grp_id"`
	EndpointId int       `json:"endpoint_id"`
	NotifyUrl  string    `json:"notify_url"`
	CreateUser string    `json:"create_user"`
	UpdateUser string    `json:"update_user"`
	ActionUser string    `json:"action_user"`
	ActionRole string    `json:"action_role"`
	CreateAt   time.Time `json:"create_at"`
	UpdateAt   time.Time `json:"update_at"`
}

type UpdateActionDto added in v1.1.0

type UpdateActionDto struct {
	TplId  int      `json:"tpl_id" binding:"required"`
	Accept []string `json:"accept"`
}

type UpdateGrp

type UpdateGrp struct {
	Groups      []*GrpTable
	Operation   string
	OperateUser string
}

type UpdateLogMonitor

type UpdateLogMonitor struct {
	LogMonitor  []*LogMonitorTable
	Operation   string
	OperateUser string
}

type UpdateRoleDto added in v1.1.0

type UpdateRoleDto struct {
	RoleId      int    `json:"role_id"`
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
	Email       string `json:"email"`
	Parent      int    `json:"parent"`
	Operator    string `json:"operator"`
	Operation   string `json:"operation" binding:"required"`
}

type UpdateRoleUserDto added in v1.1.0

type UpdateRoleUserDto struct {
	RoleId int   `json:"role_id" binding:"required"`
	UserId []int `json:"user_id"`
}

type UpdateStrategy

type UpdateStrategy struct {
	Strategy    []*StrategyTable
	Operation   string
	OperateUser string
}

type UpdateUserDto added in v1.0.1

type UpdateUserDto struct {
	NewPassword   string `form:"new_password" json:"new_password"`
	ReNewPassword string `form:"re_new_password" json:"re_new_password"`
	DisplayName   string `form:"display_name" json:"display_name"`
	Email         string `form:"email" json:"email"`
	Phone         string `form:"phone" json:"phone"`
}

type User

type User struct {
	Id       int    `json:"id" xorm:"id"`
	UserName string `json:"name" xorm:"name"`
	Password string `json:"pwd" xorm:"pwd"`
}

type UserQuery added in v1.1.0

type UserQuery struct {
	Id            int       `json:"id"`
	Name          string    `json:"name"`
	Passwd        string    `json:"passwd"`
	DisplayName   string    `json:"display_name"`
	Role          string    `json:"role"`
	Email         string    `json:"email"`
	Phone         string    `json:"phone"`
	Creator       string    `json:"creator"`
	Created       time.Time `json:"created"`
	CreatedString string    `json:"created_string"`
}

type UserTable

type UserTable struct {
	Id            int       `json:"id"`
	Name          string    `json:"name"`
	Passwd        string    `json:"passwd"`
	DisplayName   string    `json:"display_name"`
	Email         string    `json:"email"`
	Phone         string    `json:"phone"`
	ExtContactOne string    `json:"ext_contact_one"`
	ExtContactTwo string    `json:"ext_contact_two"`
	Creator       string    `json:"creator"`
	Created       time.Time `json:"created"`
}

type YaxisModel

type YaxisModel struct {
	Unit string `json:"unit"`
}

Jump to

Keyboard shortcuts

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