g

package
v0.0.0-...-a9119a5 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0, Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION                  = "0.2.0"
	CacheTTl                 = time.Minute * 30
	BYTEMAIL                 = "@xxx.com"
	BLOCK_MONITOR_SET        = "block_monitor_set"
	BLOCK_MONITOR_KEY_PREFIX = "single_block_monitor_"
)

Variables

View Source
var (
	ConfigFile string
)
View Source
var RedisConnPool *redis.Pool

Functions

func InitLog

func InitLog(level string) (err error)

func InitRedisConnPool

func InitRedisConnPool()

func JudgeIsLongInt

func JudgeIsLongInt(input string) (res bool)
func Link(event *cmodel.Event) string
func ModLink(event *cmodel.Event) string
func ModUicLink(uic string) string

func ParseConfig

func ParseConfig(cfg string)

func PingRedis

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

Types

type ApiConfig

type ApiConfig struct {
	Sms                      string `json:"sms"`
	Mail                     string `json:"mail"`
	Phone                    string `json:"phone"`
	Dashboard                string `json:"dashboard"`
	PlusApi                  string `json:"plus_api"`
	MainApi                  string `json:"main_api"`
	PlusApiToken             string `json:"plus_api_token"`
	IM                       string `json:"im"`
	LarkTenantAccessTokenUrl string `json:"lark_tenant_access_token_url"`
}

type FalconPortalConfig

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

type GlobalConfig

type GlobalConfig struct {
	LogLevel     string              `json:"log_level"`
	FalconPortal *FalconPortalConfig `json:"falcon_portal"`
	Http         *HttpConfig         `json:"http"`
	Redis        *RedisConfig        `json:"redis"`
	Api          *ApiConfig          `json:"api"`
	Worker       *WorkerConfig       `json:"worker"`
	Housekeeper  *HousekeeperConfig  `json:"Housekeeper"`
	//LarkConfig      *LarkConfig         `json:"lark_config"`
	LarkBotTokens   []string `json:"lark_bot_tokens"`
	AlarmRetryTimes int      `json:"alarm_retry_times"`
	AlarmApi        string   `json:"alarm_api"`
}

func Config

func Config() *GlobalConfig

type HousekeeperConfig

type HousekeeperConfig struct {
	EventRetentionDays int `json:"event_retention_days"`
	EventDeleteBatch   int `json:"event_delete_batch"`
}

type HttpConfig

type HttpConfig struct {
	Enabled bool   `json:"enabled"`
	Listen  string `json:"listen"`
}

type RedisConfig

type RedisConfig struct {
	Addr              string   `json:"addr"`
	RedisClusterNodes []string `json:"redis_cluster_nodes"`
	MaxIdle           int      `json:"maxIdle"`
	HighQueues        []string `json:"highQueues"`
	LowQueues         []string `json:"lowQueues"`
	UserIMQueue       string   `json:"userIMQueue"`
	UserSmsQueue      string   `json:"userSmsQueue"`
	UserMailQueue     string   `json:"userMailQueue"`
}

type WorkerConfig

type WorkerConfig struct {
	IM    int `json:"im"`
	Sms   int `json:"sms"`
	Mail  int `json:"mail"`
	Phone int `json:"phone"`
}

Jump to

Keyboard shortcuts

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