g

package
v3.14.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2017 License: Apache-2.0, Apache-2.0 Imports: 11 Imported by: 20

Documentation

Index

Constants

View Source
const (
	VERSION = "2.0.2"
)

Variables

View Source
var (
	ConfigFile string
)
View Source
var Events = &SafeEvents{M: make(map[string]*EventDto)}
View Source
var RedisConnPool *redis.Pool

Functions

func InitRedisConnPool

func InitRedisConnPool()
func Link(event *model.Event) string

func ParseConfig

func ParseConfig(cfg string)

func PingRedis

func PingRedis(c redis.Conn, t time.Time) error

Types

type ApiConfig

type ApiConfig struct {
	Portal string `json:"portal"`
	Uic    string `json:"uic"`
	Links  string `json:"links"`
}

type BossConfig

type BossConfig struct {
	Addr string `json:"addr"`
	Idle int    `json:"idle"`
	Max  int    `json:"max"`
}

type ErrorQueueSt

type ErrorQueueSt struct {
	Enable bool   `json:"enable"`
	Queue  string `json:"queue"`
}

type EventDto

type EventDto struct {
	Id       string `json:"id"`
	Endpoint string `json:"endpoint"`
	Metric   string `json:"metric"`
	Counter  string `json:"counter"`

	Func       string `json:"func"`
	LeftValue  string `json:"leftValue"`
	Operator   string `json:"operator"`
	RightValue string `json:"rightValue"`

	Note string `json:"note"`

	MaxStep     int `json:"maxStep"`
	CurrentStep int `json:"currentStep"`
	Priority    int `json:"priority"`

	Status    string `json:"status"`
	Timestamp int64  `json:"timestamp"`

	ExpressionId int `json:"expressionId"`
	StrategyId   int `json:"strategyId"`
	TemplateId   int `json:"templateId"`

	Link string `json:"link"`
}

type ExternalQueueSt

type ExternalQueueSt struct {
	Enable bool     `json:"enable"`
	Queues []string `json:"queues"`
}

type FalconPortalConfig

type FalconPortalConfig struct {
	Addr string `json:"addr"`
	Idle int    `json:"idle"`
	Max  int    `json:"max"`
}

type GlobalConfig

type GlobalConfig struct {
	Debug        bool                `json:"debug"`
	UicToken     string              `json:"uicToken"`
	Http         *HttpConfig         `json:"http"`
	FalconPortal *FalconPortalConfig `json:"falcon_portal"`
	BossConfig   *BossConfig         `json:"boss"`
	Queue        *QueueConfig        `json:"queue"`
	Redis        *RedisConfig        `json:"redis"`
	Api          *ApiConfig          `json:"api"`
	Shortcut     *ShortcutConfig     `json:"shortcut"`
	Uic          *UicConfig          `json:"uic"`
	RedirectUrl  string              `json:"redirectUrl"`
}

func Config

func Config() *GlobalConfig

type HttpConfig

type HttpConfig struct {
	Debug      bool   `json:"debug"`
	Enabled    bool   `json:"enabled"`
	Listen     string `json:"listen"`
	ViewPath   string `json:"view_path"`
	StaticPath string `json:"static_path"`
}

type OrderedEvents

type OrderedEvents []*EventDto

func (OrderedEvents) Len

func (this OrderedEvents) Len() int

func (OrderedEvents) Less

func (this OrderedEvents) Less(i, j int) bool

func (OrderedEvents) Swap

func (this OrderedEvents) Swap(i, j int)

type QueueConfig

type QueueConfig struct {
	Sms        string `json:"sms"`
	Mail       string `json:"mail"`
	QQ         string `json:"qq"`
	Serverchan string `json:"serverchan"`
}

type RedisConfig

type RedisConfig struct {
	Addr                string          `json:"addr"`
	MaxIdle             int             `json:"maxIdle"`
	HighQueues          []string        `json:"highQueues"`
	LowQueues           []string        `json:"lowQueues"`
	ExternalQueues      ExternalQueueSt `json:"externalQueues"`
	ErrorQueue          ErrorQueueSt    `json:"errorQueues"`
	UserSmsQueue        string          `json:"userSmsQueue"`
	UserMailQueue       string          `json:"userMailQueue"`
	UserQQQueue         string          `json:"userQQQueue"`
	UserServerchanQueue string          `json:"userServerchanQueue"`
}

type SafeEvents

type SafeEvents struct {
	sync.RWMutex
	M map[string]*EventDto
}

func (*SafeEvents) Clone

func (this *SafeEvents) Clone() map[string]*EventDto

func (*SafeEvents) CloneToOrderedEvents

func (this *SafeEvents) CloneToOrderedEvents() OrderedEvents

func (*SafeEvents) Delete

func (this *SafeEvents) Delete(id string)

func (*SafeEvents) Len

func (this *SafeEvents) Len() int

func (*SafeEvents) Put

func (this *SafeEvents) Put(event *model.Event)

type ShortcutConfig

type ShortcutConfig struct {
	FalconPortal     string `json:"falconPortal"`
	FalconDashboard  string `json:"falconDashboard"`
	GrafanaDashboard string `json:"grafanaDashboard"`
	FalconAlarm      string `json:"falconAlarm"`
	FalconUIC        string `json:"falconUIC"`
}

type UicConfig

type UicConfig struct {
	Addr string `json:"addr"`
	Idle int    `json:"idle"`
	Max  int    `json:"max"`
}

Jump to

Keyboard shortcuts

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