infra

package
Version: v0.0.0-...-2033adb Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCollection        = "default"
	UserCollection           = "user"
	AgentHeartBeatCollection = "agent_heartbeat"
	AgentTaskCollection      = "agent_task"
	AgentSubTaskCollection   = "agent_subtask"
)

Variables

View Source
var (
	Conf     *viper.Viper
	ConfPath string
	Sig      = make(chan os.Signal, 1)
	Quit     = make(chan bool)

	Grds          redis.UniversalClient
	MongoClient   *mongo.Client
	MongoDatabase string

	HttpPort  int
	ApiAuth   bool
	InnerAuth map[string]string
	Secret    string

	SvrName string
	SvrAK   string
	SvrSK   string

	SDAddrs      []string
	RegisterName string
	LocalIP      string
	SdAK         string
	SdSK         string
)

Functions

func CheckIPFormat

func CheckIPFormat(ip string) bool

func Contains

func Contains(items []string, item string) bool

func DistributedLock

func DistributedLock(key string) (bool, error)

func DistributedUnLock

func DistributedUnLock(key string) error

func GetOutboundIP

func GetOutboundIP() (string, error)

func InitConfig

func InitConfig()

func RandStringBytes

func RandStringBytes(n int) string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL