base

package
v0.0.0-...-d09ac20 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Success      = 200
	BadRequest   = 400
	SystemError  = 500
	MissingParam = 1001
	ParamError   = 1002

	AirVisualDataLock = "AirVisualDataLock"

	SockAddr           = "/var/run//docker.sock"                          // docker官方文档定义的套接字默认值
	ImagesSock         = "GET /images/json HTTP/1.0\r\n\r\n"              // docker对外的镜像操作api
	ContainerSock      = "GET /containers/json?all=true HTTP/1.0\r\n\r\n" // docker对外的容器查询api
	StartContainerSock = "POST /containers/%s/start HTTP/1.0\r\n\r\n"     // docker对外的容器启动api
)

Variables

View Source
var CodeText = map[int]string{
	Success:      "Success",
	BadRequest:   "Bad Request",
	SystemError:  "System error",
	MissingParam: "Missing param",
	ParamError:   "Param error",
}
View Source
var DBEngine *xorm.Engine

Functions

func ConfigInit

func ConfigInit()

func DbInit

func DbInit()

func GetConfig

func GetConfig() *tomlConfig

func LogInit

func LogInit()

Types

type DB

type DB struct {
	Database    string
	Username    string
	Password    string
	Host        string
	MaxOpenConn int
	MaxIdleConn int
}

type Docker

type Docker struct {
	WhiteList []string
	Interval  int
}

type Etcd

type Etcd struct {
	Endpoints []string
	Keys      []string
	Ip        string
}

type InfluxDB

type InfluxDB struct {
	Database        string
	Ip              string
	Port            string
	Username        string
	Password        string
	RetentionPolicy string
}

type Kafka

type Kafka struct {
	Hosts          []string
	ConsumeTopic   []string
	ConsumeGroupId string
	PublishTopic   string
	Key            string
}

type Log

type Log struct {
	Path  string
	Level string
}

type MQ

type MQ struct {
	Ip           string
	Port         string
	Username     string
	Password     string
	Host         string
	Exchange     string
	Key          string
	Queue        string
	ChanRangeNum int
}

type Mail

type Mail struct {
	Username string
	Password string
	Nickname string
	MailType string
}

type Nsq

type Nsq struct {
	Address string
	Topic   string
	Channel string
}

type Redis

type Redis struct {
	MaxIdle  int
	Timeout  int
	Ip       string
	Port     string
	Password string
}

type Server

type Server struct {
	RunMode      string
	HttpPort     int
	RpcPort      int
	ReadTimeout  int64
	WriteTimeout int64
}

Jump to

Keyboard shortcuts

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