Documentation ¶
Index ¶
- Constants
- Variables
- func InitConfig() error
- func InitLogger() error
- func NewApiServer(controller *Controller) *apiServer
- func NewPlugin(pluginType string, config *viper.Viper) (plugin plugin, err error)
- func ParseConfig(configFilePath string) error
- func RearrangeJson(i interface{}) (rearrangedJsonString string, err error)
- func RenderJson(w http.ResponseWriter, v interface{})
- func SendToArgus(dataChan chan interface{})
- type ApiConfig
- type Controller
- func (ct *Controller) AddJob(id string, originConfigString string) (map[string]interface{}, error)
- func (ct *Controller) DelJob(id string) (map[string]interface{}, error)
- func (ct *Controller) GetAllJob() (result map[string]interface{})
- func (ct *Controller) GetAllStatus() (result map[string]interface{})
- func (ct *Controller) GetConfig() map[string]interface{}
- func (ct *Controller) GetInstanceSeq() uint
- func (ct *Controller) GetInstanceTotal() uint
- func (ct *Controller) GetJob(ids []string) (result map[string]interface{})
- func (ct *Controller) GetStatus(ids []string) (result map[string]interface{})
- func (ct *Controller) ReloadAllJobs() map[string]interface{}
- func (ct *Controller) Start()
- func (ct *Controller) UpdateJob(id string, originConfigString string) (map[string]interface{}, error)
- type ControllerConfig
- type GlobalConfig
- type Job
- type JobConfig
- type JobSourceArgusConfig
- type JobSourceFileConfig
- type PushConfig
Constants ¶
View Source
const ( JOB_STATUS_AVAILABLE = "available" JOB_STATUS_RUNNING = "running" JOB_STATUS_STOPPED = "stopped" JOB_STATUS_BLOCKING = "blocking" JOB_SIGNAL_CACHE_SIZE = 1 JOB_SIGNAL_STOP = "exit" JOB_EXCUTE_POOL_SIZE = 3 )
View Source
const (
PUSH_INTERVAL = 1 * time.Millisecond //单位毫秒
)
Variables ¶
View Source
var (
Home string
)
Functions ¶
func InitConfig ¶
func InitConfig() error
func InitLogger ¶
func InitLogger() error
func NewApiServer ¶
func NewApiServer(controller *Controller) *apiServer
func ParseConfig ¶
func RearrangeJson ¶
func RenderJson ¶
func RenderJson(w http.ResponseWriter, v interface{})
func SendToArgus ¶
func SendToArgus(dataChan chan interface{})
Types ¶
type Controller ¶
type Controller struct { Total uint //当前注册的 controller 总数量 Seq uint //本 controller 的编号 // contains filtered or unexported fields }
func NewController ¶
func NewController() *Controller
func (*Controller) AddJob ¶
func (ct *Controller) AddJob(id string, originConfigString string) (map[string]interface{}, error)
func (*Controller) GetAllJob ¶
func (ct *Controller) GetAllJob() (result map[string]interface{})
func (*Controller) GetAllStatus ¶
func (ct *Controller) GetAllStatus() (result map[string]interface{})
func (*Controller) GetConfig ¶
func (ct *Controller) GetConfig() map[string]interface{}
func (*Controller) GetInstanceSeq ¶
func (ct *Controller) GetInstanceSeq() uint
func (*Controller) GetInstanceTotal ¶
func (ct *Controller) GetInstanceTotal() uint
func (*Controller) GetJob ¶
func (ct *Controller) GetJob(ids []string) (result map[string]interface{})
func (*Controller) GetStatus ¶
func (ct *Controller) GetStatus(ids []string) (result map[string]interface{})
func (*Controller) ReloadAllJobs ¶
func (ct *Controller) ReloadAllJobs() map[string]interface{}
func (*Controller) Start ¶
func (ct *Controller) Start()
type ControllerConfig ¶
type GlobalConfig ¶
type GlobalConfig struct { Push *PushConfig `json:"push"` Controller *ControllerConfig `json:"controller"` Api *ApiConfig `json:"api"` Job *JobConfig `json:"job"` }
func Config ¶
func Config() *GlobalConfig
type JobConfig ¶
type JobConfig struct { Source string `json:"source"` //job监控配置的来源,目前可选file或etcd File *JobSourceFileConfig `json:"file"` //来源为file的配置 Argus *JobSourceArgusConfig `json:"argus"` //来源为etcd的配置 }
type JobSourceArgusConfig ¶
type JobSourceArgusConfig struct { }
type JobSourceFileConfig ¶
type JobSourceFileConfig struct {
Path string `json:"path"` //文件路径
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.