common

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MASTER_CLUSTER_FIXED_ID    = 1
	CLUSTER_FIXED_TOKEN = "test"
)

Variables

View Source
var (
	OK                 = &FbaseError{0, "success"}
	INTERNAL_ERROR     = &FbaseError{1, "internal error"}
	DB_ERROR           = &FbaseError{2, "db error"}
	HTTP_REQUEST_ERROR = &FbaseError{3, "send http request is failed"}

	PARSE_PARAM_ERROR  = &FbaseError{4, "parse parameters error"}
	PARAM_FORMAT_ERROR = &FbaseError{5, "parameters format error"}

	CLUSTER_NOTEXISTS_ERROR = &FbaseError{6, "cluster not exists"}
	CLUSTER_DUPCREATE_ERROR = &FbaseError{7, "create duplicated cluster"}
	TABLE_NOT_EXISTS        = &FbaseError{8, "table not exists"}
	NO_DATA                 = &FbaseError{9, "no data"}
	NO_RIGHT                = &FbaseError{10, "no right, please contact sharkstore team"}
	NO_USER                 = &FbaseError{11, "please login retry"}
)

Functions

func Argument

func Argument(d map[string]interface{}, name string) (string, bool)

func ArgumentInteger

func ArgumentInteger(d map[string]interface{}, name string) (int, bool)

func ArgumentIntegerMust

func ArgumentIntegerMust(d map[string]interface{}, name string) int

func ArgumentMust

func ArgumentMust(d map[string]interface{}, name string) string

func BuildNewClusterToken

func BuildNewClusterToken(clusterId int, clusterName string, cToken string) string

集群1与其他集群签名规则一致

func CalcMsReqSign

func CalcMsReqSign(cId int, cToken string, ts int64) string

func GetCookie

func GetCookie(request *http.Request, name string) string

func Md5Sum

func Md5Sum(data string) string

Types

type FbaseError

type FbaseError struct {
	Code int
	Msg  string
}

func (*FbaseError) Error

func (e *FbaseError) Error() string

Jump to

Keyboard shortcuts

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