misc

package
v0.0.0-...-3d8f939 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2019 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//CQLNotFound  when acess cql, get the not found result
	CQLNotFound = "not found"
)

Variables

View Source
var Base64 = base64.NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")

Base64 is the base64 handler

CQL is the cql session for access cassandra

IDGen generate ditrubuted unique id

Log is the global var for log

View Source
var Sanitizer *bluemonday.Policy

Sanitizer makes outside string clean

Functions

func GenID

func GenID() string

GenID return a hex number string

func InitConf

func InitConf(p string)

InitConf init the config for dashboard

func InitLog

func InitLog(level string)

InitLog the logger interface

Types

type Config

type Config struct {
	Version    string `yaml:"version"`
	LogLevel   string `yaml:"log_level"`
	ListenAddr string `yaml:"listen_addr"`
	CQL        struct {
		Cluster       []string `yaml:"cluster"`
		ConnectionNum int      `yaml:"connection_num"`
		Keyspace      string
	}
}

Config for dashboardå

var Conf *Config

Conf is the global var for config

type HTTPResp

type HTTPResp struct {
	ErrCode int `json:"err_code"`

	Message string `json:"message"`

	Data interface{} `json:"data"`
}

HTTPResp is the structure for http response

Jump to

Keyboard shortcuts

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