common

package
v0.0.0-...-1fc07e7 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInitNodeBucket      = errors.New("init node bucket fail")
	ErrInitNodeKey         = errors.New("init node bucket k-v fail")
	ErrGetNode             = errors.New("get node fail")
	ErrNodeNotFound        = errors.New("node not found")
	ErrGetParent           = errors.New("get parent node error")
	ErrCreateNodeUnderLeaf = errors.New("can not create node under leaf node")
	ErrSetResourceToLeaf   = errors.New("can not set resource to leaf node")
	ErrGetNodeID           = errors.New("get nodeid fail")
	ErrInvalidParam        = errors.New("invalid param")
	ErrNilChildNode        = errors.New("get none child node")
	ErrNodeAlreadyExist    = errors.New("node already exist")
	ErrNoLeafChild         = errors.New("have no leaf child node")
	ErrNotAllowDel         = errors.New("not allow to be delete")

	ErrEmptyResource error = errors.New("empty resources")

	ErrGroupNotFound     = errors.New("group not found")
	ErrGroupAlreadyExist = errors.New("group already exist")
	ErrUserNotFound      = errors.New("user not found")
)

Functions

func AddIfNotContain

func AddIfNotContain(sl []string, v string) ([]string, bool)

func CheckStringInList

func CheckStringInList(sl []string, v string) bool

func ContainString

func ContainString(sl []string, v string) (int, bool)

func GenUUID

func GenUUID() string

func RemoveIfContain

func RemoveIfContain(sl []string, v string) ([]string, bool)

RemoveIfContain remove the first string in the string list.

func Reverse

func Reverse(ori []string) []string

Types

This section is empty.

Jump to

Keyboard shortcuts

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