agents

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2019 License: MIT Imports: 30 Imported by: 17

Documentation

Index

Constants

View Source
const (
	SourceDataFormatSingeLine    = 1 // 单行
	SourceDataFormatMultipleLine = 2 // 多行
	SourceDataFormatJSON         = 3 // JSON
	SourceDataFormatYAML         = 4 // YAML
)
View Source
const (
	ThresholdOperatorRegexp      = "regexp"
	ThresholdOperatorNotRegexp   = "not regexp"
	ThresholdOperatorGt          = "gt"
	ThresholdOperatorGte         = "gte"
	ThresholdOperatorLt          = "lt"
	ThresholdOperatorLte         = "lte"
	ThresholdOperatorEq          = "eq"
	ThresholdOperatorNot         = "not"
	ThresholdOperatorPrefix      = "prefix"
	ThresholdOperatorSuffix      = "suffix"
	ThresholdOperatorContains    = "contains"
	ThresholdOperatorNotContains = "not contains"
)

Variables

This section is empty.

Functions

func AllActions

func AllActions() []maps.Map

获取所有的数据源信息

func AllDataSources

func AllDataSources() []maps.Map

获取所有的数据源信息

func AllSourceDataFormats

func AllSourceDataFormats() []maps.Map

所有的数据格式

func AllThresholdOperators

func AllThresholdOperators() []maps.Map

所有的运算符

func DecodeSource

func DecodeSource(data []byte, format SourceDataFormat) (value interface{}, err error)

解码数据

func FindAction

func FindAction(code string) maps.Map

查找单个数据源信息

func FindDataSource

func FindDataSource(code string) maps.Map

查找单个数据源信息

func FindSourceDataFormat

func FindSourceDataFormat(dataFormat SourceDataFormat) maps.Map

取得单个数据格式

func FindThresholdOperator

func FindThresholdOperator(op string) maps.Map

查找某个运算符信息

Types

type ActionInterface

type ActionInterface interface {
	// 名称
	Name() string

	// 代号
	Code() string

	// 描述
	Description() string

	// 校验
	Validate() error

	// 执行
	Run(params map[string]string) (result string, err error)

	// 获取简要信息
	Summary() maps.Map
}

动作

func FindActionInstance

func FindActionInstance(code string, options map[string]interface{}) ActionInterface

查找单个数据源实例

type AgentConfig

type AgentConfig struct {
	Id                  string       `yaml:"id" json:"id"`                                   // ID
	On                  bool         `yaml:"on" json:"on"`                                   // 是否启用
	Name                string       `yaml:"name" json:"name"`                               // 名称
	Host                string       `yaml:"host" json:"host"`                               // 主机地址
	Key                 string       `yaml:"key" json:"key"`                                 // 密钥
	AllowAll            bool         `yaml:"allowAll" json:"allowAll"`                       // 是否允许所有的IP
	Allow               []string     `yaml:"allow" json:"allow"`                             // 允许的IP地址
	Apps                []*AppConfig `yaml:"apps" json:"apps"`                               // Apps
	Version             uint         `yaml:"version" json:"version"`                         // 版本
	CountDisconnections int          `yaml:"countDisconnections" json:"countDisconnections"` // 错误次数
	GroupIds            []string     `yaml:"groupIds" json:"groupIds"`                       // 分组IDs
}

Agent定义

func LocalAgentConfig

func LocalAgentConfig() *AgentConfig

func NewAgentConfig

func NewAgentConfig() *AgentConfig

获取新对象

func NewAgentConfigFromFile

func NewAgentConfigFromFile(filename string) *AgentConfig

从文件中获取对象

func NewAgentConfigFromId

func NewAgentConfigFromId(agentId string) *AgentConfig

根据ID获取对象

func (*AgentConfig) AddApp

func (this *AgentConfig) AddApp(app *AppConfig)

添加App

func (*AgentConfig) AddApps

func (this *AgentConfig) AddApps(apps []*AppConfig)

添加一组App

func (*AgentConfig) AddGroup

func (this *AgentConfig) AddGroup(groupId string)

添加分组

func (*AgentConfig) Delete

func (this *AgentConfig) Delete() error

删除

func (*AgentConfig) EncodeYAML

func (this *AgentConfig) EncodeYAML() ([]byte, error)

YAML编码

func (*AgentConfig) Filename

func (this *AgentConfig) Filename() string

文件名

func (*AgentConfig) FindApp

func (this *AgentConfig) FindApp(appId string) *AppConfig

查找App

func (*AgentConfig) FindItem

func (this *AgentConfig) FindItem(itemId string) (appConfig *AppConfig, item *Item)

查找监控项

func (*AgentConfig) FindSystemApps

func (this *AgentConfig) FindSystemApps() []*AppConfig

取得系统App列表

func (*AgentConfig) FindTask

func (this *AgentConfig) FindTask(taskId string) (appConfig *AppConfig, taskConfig *TaskConfig)

查找任务

func (*AgentConfig) IsLocal

func (this *AgentConfig) IsLocal() bool

判断是否为Local Agent

func (*AgentConfig) RemoveApp

func (this *AgentConfig) RemoveApp(appId string)

删除App

func (*AgentConfig) RemoveGroup

func (this *AgentConfig) RemoveGroup(groupId string)

删除分组

func (*AgentConfig) ResetSystemApps

func (this *AgentConfig) ResetSystemApps()

清除系统App

func (*AgentConfig) Save

func (this *AgentConfig) Save() error

保存

func (*AgentConfig) Validate

func (this *AgentConfig) Validate() error

校验

type AgentList

type AgentList struct {
	Files []string `yaml:"files" json:"files"`
}

Agent列表

func SharedAgentList

func SharedAgentList() (*AgentList, error)

取得Agent列表

func (*AgentList) AddAgent

func (this *AgentList) AddAgent(agentFile string)

添加Agent

func (*AgentList) FindAllAgents

func (this *AgentList) FindAllAgents() []*AgentConfig

查找所有Agents

func (*AgentList) MoveAgent

func (this *AgentList) MoveAgent(fromId string, toId string)

移动位置

func (*AgentList) RemoveAgent

func (this *AgentList) RemoveAgent(agentFile string)

删除Agent

func (*AgentList) Save

func (this *AgentList) Save() error

保存

type AppConfig

type AppConfig struct {
	Id       string        `yaml:"id" json:"id"`             // ID
	On       bool          `yaml:"on" json:"on"`             // 是否启用
	Tasks    []*TaskConfig `yaml:"tasks" json:"tasks"`       // 任务设置
	Items    []*Item       `yaml:"item" json:"items"`        // 监控项
	Name     string        `yaml:"name" json:"name"`         // 名称
	IsSystem bool          `yaml:"isSystem" json:"isSystem"` // 是否为系统定义
}

App定义

func NewAppConfig

func NewAppConfig() *AppConfig

获取新对象

func NewSystemAppConfig

func NewSystemAppConfig(id string) *AppConfig

获取非用户定义对象

func (*AppConfig) AddItem

func (this *AppConfig) AddItem(item *Item)

添加监控项

func (*AppConfig) AddTask

func (this *AppConfig) AddTask(task *TaskConfig)

添加任务

func (*AppConfig) FindBootingTasks

func (this *AppConfig) FindBootingTasks() []*TaskConfig

Boot Tasks

func (*AppConfig) FindItem

func (this *AppConfig) FindItem(itemId string) *Item

查找监控项

func (*AppConfig) FindManualTasks

func (this *AppConfig) FindManualTasks() []*TaskConfig

Manual Tasks

func (*AppConfig) FindSchedulingTasks

func (this *AppConfig) FindSchedulingTasks() []*TaskConfig

Schedule Tasks

func (*AppConfig) FindTask

func (this *AppConfig) FindTask(taskId string) *TaskConfig

查找任务

func (*AppConfig) RemoveItem

func (this *AppConfig) RemoveItem(itemId string)

删除监控项

func (*AppConfig) RemoveTask

func (this *AppConfig) RemoveTask(taskId string)

删除任务

func (*AppConfig) Validate

func (this *AppConfig) Validate() error

校验

type Board

type Board struct {
	Filename string        `yaml:"filename" json:"filename"`
	Charts   []*BoardChart `yaml:"charts" json:"charts"`
}

看板

func NewAgentBoard

func NewAgentBoard(agentId string) *Board

取得Agent看板

func (*Board) AddChart

func (this *Board) AddChart(appId, itemId, chartId string)

添加图表

func (*Board) FindChart

func (this *Board) FindChart(chartId string) *BoardChart

查找图表

func (*Board) RemoveChart

func (this *Board) RemoveChart(chartId string)

删除图表

func (*Board) Save

func (this *Board) Save() error

保存

type BoardChart

type BoardChart struct {
	AppId   string `yaml:"appId" json:"appId"`
	ItemId  string `yaml:"itemId" json:"itemId"`
	ChartId string `yaml:"chartId" json:"chartId"`
}

看板图表定义

type FileSource

type FileSource struct {
	Path       string           `yaml:"path" json:"path"`
	DataFormat SourceDataFormat `yaml:"dataFormat" json:"dataFormat"` // 数据格式
}

数据文件

func NewFileSource

func NewFileSource() *FileSource

获取新对象

func (*FileSource) Code

func (this *FileSource) Code() string

代号

func (*FileSource) DataFormatCode

func (this *FileSource) DataFormatCode() SourceDataFormat

数据格式

func (*FileSource) Description

func (this *FileSource) Description() string

描述

func (*FileSource) Execute

func (this *FileSource) Execute(params map[string]string) (value interface{}, err error)

执行

func (*FileSource) Name

func (this *FileSource) Name() string

名称

func (*FileSource) Summary

func (this *FileSource) Summary() maps.Map

获取简要信息

func (*FileSource) Validate

func (this *FileSource) Validate() error

校验

type Group

type Group struct {
	Id            string                                            `yaml:"id" json:"id"`
	On            bool                                              `yaml:"on" json:"on"`
	Name          string                                            `yaml:"name" json:"name"`
	Index         int                                               `yaml:"index" json:"index"`
	NoticeSetting map[notices.NoticeLevel][]*notices.NoticeReceiver `yaml:"noticeSetting" json:"noticeSetting"`
}

Agent分组

func NewGroup

func NewGroup(name string) *Group

获取新分组

func (*Group) AddNoticeReceiver

func (this *Group) AddNoticeReceiver(level notices.NoticeLevel, receiver *notices.NoticeReceiver)

添加通知接收者

func (*Group) RemoveNoticeReceiver

func (this *Group) RemoveNoticeReceiver(level notices.NoticeLevel, receiverId string)

删除通知接收者

type GroupConfig

type GroupConfig struct {
	Filename string   `yaml:"filename" json:"filename"`
	Groups   []*Group `yaml:"groups" json:"groups"`
}

分组配置

func SharedGroupConfig

func SharedGroupConfig() *GroupConfig

取得公用的配置

func (*GroupConfig) AddGroup

func (this *GroupConfig) AddGroup(group *Group)

添加分组

func (*GroupConfig) FindAllGroups

func (this *GroupConfig) FindAllGroups() []*Group

获取所有分组,包括默认分组

func (*GroupConfig) FindGroup

func (this *GroupConfig) FindGroup(groupId string) *Group

查找分组

func (*GroupConfig) Move

func (this *GroupConfig) Move(fromIndex int, toIndex int)

移动位置

func (*GroupConfig) RemoveGroup

func (this *GroupConfig) RemoveGroup(groupId string)

删除分组

func (*GroupConfig) Save

func (this *GroupConfig) Save() error

保存

type Item

type Item struct {
	On            bool                   `yaml:"on" json:"on"`
	Id            string                 `yaml:"id" json:"id"`
	Name          string                 `yaml:"name" json:"name"`
	SourceCode    string                 `yaml:"sourceCode" json:"sourceCode"`       // 数据源代号
	SourceOptions map[string]interface{} `yaml:"sourceOptions" json:"sourceOptions"` // 数据源选项
	Interval      string                 `yaml:"interval" json:"interval"`           // 刷新间隔
	Thresholds    []*Threshold           `yaml:"thresholds" json:"thresholds"`       // 阈值设置
	Charts        []*widgets.Chart       `yaml:"charts" json:"charts"`               // 图表
	// contains filtered or unexported fields
}

数据指标项

func NewItem

func NewItem() *Item

获取新对象

func (*Item) AddChart

func (this *Item) AddChart(chart *widgets.Chart)

添加图表

func (*Item) AddThreshold

func (this *Item) AddThreshold(t *Threshold)

添加阈值

func (*Item) FindChart

func (this *Item) FindChart(chartId string) *widgets.Chart

查找图表

func (*Item) IntervalDuration

func (this *Item) IntervalDuration() time.Duration

获取刷新间隔

func (*Item) RemoveChart

func (this *Item) RemoveChart(chartId string)

删除图表

func (*Item) Source

func (this *Item) Source() SourceInterface

数据源对象

func (*Item) TestValue

func (this *Item) TestValue(value interface{}) (level notices.NoticeLevel, message string)

检查某个值对应的通知级别

func (*Item) Validate

func (this *Item) Validate() error

校验

type ScheduleConfig

type ScheduleConfig struct {
	SecondRanges  []*ScheduleRangeConfig `yaml:"secondRanges" json:"secondRanges"`   // 秒
	MinuteRanges  []*ScheduleRangeConfig `yaml:"minuteRanges" json:"minuteRanges"`   // 分
	HourRanges    []*ScheduleRangeConfig `yaml:"hourRanges" json:"hourRanges"`       // 小时
	DayRanges     []*ScheduleRangeConfig `yaml:"dayRanges" json:"dayRanges"`         // 天
	MonthRanges   []*ScheduleRangeConfig `yaml:"monthRanges" json:"monthRanges"`     // 月
	YearRanges    []*ScheduleRangeConfig `yaml:"yearRanges" json:"yearRanges"`       // 年份
	WeekDayRanges []*ScheduleRangeConfig `yaml:"weekDayRanges" json:"weekDayRanges"` // 一周中的某天,1-7
	// contains filtered or unexported fields
}

定时

func NewScheduleConfig

func NewScheduleConfig() *ScheduleConfig

定时新对象

func (*ScheduleConfig) AddDayRanges

func (this *ScheduleConfig) AddDayRanges(r ...*ScheduleRangeConfig)

添加天设置

func (*ScheduleConfig) AddHourRanges

func (this *ScheduleConfig) AddHourRanges(r ...*ScheduleRangeConfig)

添加小时设置

func (*ScheduleConfig) AddMinuteRanges

func (this *ScheduleConfig) AddMinuteRanges(r ...*ScheduleRangeConfig)

添加分钟设置

func (*ScheduleConfig) AddMonthRanges

func (this *ScheduleConfig) AddMonthRanges(r ...*ScheduleRangeConfig)

添加月设置

func (*ScheduleConfig) AddSecondRanges

func (this *ScheduleConfig) AddSecondRanges(r ...*ScheduleRangeConfig)

添加秒设置

func (*ScheduleConfig) AddWeekDayRanges

func (this *ScheduleConfig) AddWeekDayRanges(r ...*ScheduleRangeConfig)

添加周N设置

func (*ScheduleConfig) AddYearRanges

func (this *ScheduleConfig) AddYearRanges(r ...*ScheduleRangeConfig)

添加年设置

func (*ScheduleConfig) Next

func (this *ScheduleConfig) Next(now time.Time) (t time.Time, ok bool)

下次运行时间

func (*ScheduleConfig) ShouldRun

func (this *ScheduleConfig) ShouldRun(t time.Time) bool

判断时间是否匹配

func (*ScheduleConfig) Summary

func (this *ScheduleConfig) Summary() string

Summary

func (*ScheduleConfig) Validate

func (this *ScheduleConfig) Validate() error

校验

type ScheduleRangeConfig

type ScheduleRangeConfig struct {
	Every bool `yaml:"every" json:"every"`
	From  int  `yaml:"from" json:"from"`
	To    int  `yaml:"to" json:"to"`
	Step  int  `yaml:"step" json:"step"`
	Value int  `yaml:"value" json:"value"`
}

Schedule时间范围

func NewScheduleRangeConfig

func NewScheduleRangeConfig() *ScheduleRangeConfig

获取新对象

type ScheduleRangeList

type ScheduleRangeList struct {
	Every  bool
	Ranges []*ScheduleRangeConfig
}

定时列表

func NewScheduleRangeList

func NewScheduleRangeList() *ScheduleRangeList

获取新对象

func (*ScheduleRangeList) Convert

func (this *ScheduleRangeList) Convert(ranges []*ScheduleRangeConfig)

转换

func (*ScheduleRangeList) Next

func (this *ScheduleRangeList) Next(current int, defaultValue int) int

下一个数值

type ScriptAction

type ScriptAction struct {
	Path       string                `yaml:"path" json:"path"`
	ScriptType string                `yaml:"scriptType" json:"scriptType"` // 脚本类型,可以为path, code
	ScriptLang string                `yaml:"scriptLang" json:"scriptLang"` // 脚本语言
	Script     string                `yaml:"script" json:"script"`         // 脚本代码
	Env        []*shared.EnvVariable `yaml:"env" json:"env"`               // 环境变量设置
	Cwd        string                `yaml:"cwd" json:"cwd"`
}

Script文件数据源

func NewScriptAction

func NewScriptAction() *ScriptAction

获取新对象

func (*ScriptAction) AddEnv

func (this *ScriptAction) AddEnv(name, value string)

添加环境变量

func (*ScriptAction) Code

func (this *ScriptAction) Code() string

代号

func (*ScriptAction) Description

func (this *ScriptAction) Description() string

描述

func (*ScriptAction) FormattedScript

func (this *ScriptAction) FormattedScript() string

格式化脚本

func (*ScriptAction) Generate

func (this *ScriptAction) Generate(id string) (path string, err error)

保存到本地

func (*ScriptAction) Name

func (this *ScriptAction) Name() string

func (*ScriptAction) Run

func (this *ScriptAction) Run(params map[string]string) (result string, err error)

执行

func (*ScriptAction) Summary

func (this *ScriptAction) Summary() maps.Map

获取简要信息

func (*ScriptAction) Validate

func (this *ScriptAction) Validate() error

type ScriptSource

type ScriptSource struct {
	Path       string                `yaml:"path" json:"path"`
	ScriptType string                `yaml:"scriptType" json:"scriptType"` // 脚本类型,可以为path, code
	ScriptLang string                `yaml:"scriptLang" json:"scriptLang"` // 脚本语言
	Script     string                `yaml:"script" json:"script"`         // 脚本代码
	Env        []*shared.EnvVariable `yaml:"env" json:"env"`               // 环境变量设置
	Cwd        string                `yaml:"cwd" json:"cwd"`
	DataFormat SourceDataFormat      `yaml:"dataFormat" json:"dataFormat"` // 数据格式
}

Script文件数据源

func NewScriptSource

func NewScriptSource() *ScriptSource

获取新对象

func (*ScriptSource) AddEnv

func (this *ScriptSource) AddEnv(name, value string)

添加环境变量

func (*ScriptSource) Code

func (this *ScriptSource) Code() string

代号

func (*ScriptSource) DataFormatCode

func (this *ScriptSource) DataFormatCode() SourceDataFormat

数据格式

func (*ScriptSource) Description

func (this *ScriptSource) Description() string

描述

func (*ScriptSource) Execute

func (this *ScriptSource) Execute(params map[string]string) (value interface{}, err error)

执行

func (*ScriptSource) FormattedScript

func (this *ScriptSource) FormattedScript() string

格式化脚本

func (*ScriptSource) Generate

func (this *ScriptSource) Generate(id string) (path string, err error)

保存到本地

func (*ScriptSource) Name

func (this *ScriptSource) Name() string

名称

func (*ScriptSource) Summary

func (this *ScriptSource) Summary() maps.Map

获取简要信息

func (*ScriptSource) Validate

func (this *ScriptSource) Validate() error

校验

type SourceDataFormat

type SourceDataFormat = uint8

数据格式

type SourceInterface

type SourceInterface interface {
	// 名称
	Name() string

	// 代号
	Code() string

	// 描述
	Description() string

	// 校验
	Validate() error

	// 执行
	Execute(params map[string]string) (value interface{}, err error)

	// 获得数据格式
	DataFormatCode() SourceDataFormat

	// 获取简要信息
	Summary() maps.Map
}

数据源接口定义

func FindDataSourceInstance

func FindDataSourceInstance(code string, options map[string]interface{}) SourceInterface

查找单个数据源实例

type TaskConfig

type TaskConfig struct {
	Id        string                `yaml:"id" json:"id"`               // ID
	On        bool                  `yaml:"on" json:"on"`               // 是否启用
	Name      string                `yaml:"name" json:"name"`           // 名称
	Cwd       string                `yaml:"cwd" json:"cwd"`             // 当前工作目录(Current Working Directory)
	Env       []*shared.EnvVariable `yaml:"env" json:"env"`             // 环境变量设置
	Script    string                `yaml:"script" json:"script"`       // 脚本
	IsBooting bool                  `yaml:"isBooting" json:"isBooting"` // 在Boot时启动
	Schedule  []*ScheduleConfig     `yaml:"schedule" json:"schedule"`   // 定时
	IsManual  bool                  `yaml:"isManual" json:"isManual"`   // 是否手工调用
	Version   uint                  `yaml:"version" json:"version"`     // 版本
}

任务 日志存储在 task.${id}

func NewTaskConfig

func NewTaskConfig() *TaskConfig

获取新对象

func (*TaskConfig) AddEnv

func (this *TaskConfig) AddEnv(name string, value string)

添加环境变量

func (*TaskConfig) AddSchedule

func (this *TaskConfig) AddSchedule(schedule *ScheduleConfig)

添加定时

func (*TaskConfig) FormattedScript

func (this *TaskConfig) FormattedScript() string

格式化脚本

func (*TaskConfig) Generate

func (this *TaskConfig) Generate() (path string, err error)

保存到本地

func (*TaskConfig) GenerateAgain

func (this *TaskConfig) GenerateAgain() (path string, err error)

重新生成

func (*TaskConfig) Next

func (this *TaskConfig) Next(now time.Time) (next time.Time, ok bool)

取得下次运行时间

func (*TaskConfig) Validate

func (this *TaskConfig) Validate() error

校验

type Threshold

type Threshold struct {
	Id            string                   `yaml:"id" json:"id"`                       // ID
	Param         string                   `yaml:"param" json:"param"`                 // 参数
	Operator      ThresholdOperator        `yaml:"operator" json:"operator"`           // 运算符
	Value         string                   `yaml:"value" json:"value"`                 // 对比值
	NoticeLevel   notices.NoticeLevel      `yaml:"noticeLevel" json:"noticeLevel"`     // 通知级别
	NoticeMessage string                   `yaml:"noticeMessage" json:"noticeMessage"` // 通知消息
	Actions       []map[string]interface{} `yaml:"actions" json:"actions"`             // 动作配置
	// contains filtered or unexported fields
}

阈值定义

func NewThreshold

func NewThreshold() *Threshold

新阈值对象

func (*Threshold) Eval

func (this *Threshold) Eval(value interface{}) string

执行数值运算,使用Javascript语法

func (*Threshold) RunActions

func (this *Threshold) RunActions(params map[string]string) error

执行动作

func (*Threshold) Test

func (this *Threshold) Test(value interface{}) bool

将此条件应用于阈值,检查是否匹配

func (*Threshold) Validate

func (this *Threshold) Validate() error

校验

type ThresholdOperator

type ThresholdOperator = string

运算符定义

type Value

type Value struct {
	Id          primitive.ObjectID  `bson:"_id" json:"id"`                  // 数据库存储的ID
	AgentId     string              `bson:"agentId" json:"agentId"`         // Agent ID
	AppId       string              `bson:"appId" json:"appId"`             // App ID
	ItemId      string              `bson:"itemId" json:"itemId"`           // 监控项ID
	Timestamp   int64               `bson:"timestamp" json:"timestamp"`     // 时间戳
	Value       interface{}         `bson:"value" json:"value"`             // 值,可以是个标量,或者一个组合的值
	Error       string              `bson:"error" json:"error"`             // 错误信息
	NoticeLevel notices.NoticeLevel `bson:"noticeLevel" json:"noticeLevel"` // 通知级别
	TimeFormat  struct {
		Year   string `bson:"year" json:"year"`
		Month  string `bson:"month" json:"month"`
		Day    string `bson:"day" json:"day"`
		Hour   string `bson:"hour" json:"hour"`
		Minute string `bson:"minute" json:"minute"`
		Second string `bson:"second" json:"second"`
	} `bson:"timeFormat" json:"timeFormat"`
}

应用指标值定义

func NewValue

func NewValue() *Value

获取新对象

func (*Value) SetTime

func (this *Value) SetTime(t time.Time)

设置时间

type WebHookSource

type WebHookSource struct {
	URL        string           `yaml:"url" json:"url"`
	Timeout    string           `yaml:"timeout" json:"timeout"`
	Method     string           `yaml:"method" json:"method"`         // 请求方法
	DataFormat SourceDataFormat `yaml:"dataFormat" json:"dataFormat"` // 数据格式
	// contains filtered or unexported fields
}

WebHook

func NewWebHookSource

func NewWebHookSource() *WebHookSource

获取新对象

func (*WebHookSource) Code

func (this *WebHookSource) Code() string

代号

func (*WebHookSource) DataFormatCode

func (this *WebHookSource) DataFormatCode() SourceDataFormat

数据格式

func (*WebHookSource) Description

func (this *WebHookSource) Description() string

描述

func (*WebHookSource) Execute

func (this *WebHookSource) Execute(params map[string]string) (value interface{}, err error)

执行

func (*WebHookSource) Name

func (this *WebHookSource) Name() string

名称

func (*WebHookSource) Summary

func (this *WebHookSource) Summary() maps.Map

获取简要信息

func (*WebHookSource) Validate

func (this *WebHookSource) Validate() error

校验

Jump to

Keyboard shortcuts

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