global

package
v0.0.0-...-f0b2648 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DEFAULT_OPTS_USER_PERMISSION  = 1
	DEFAULT_OPTS_GROUP_PERMISSION = 1
	DEFAULT_OPTS_TAGS             = ""
)
View Source
const (
	DEFAULT_TREE_LEVEL = 5
)

Variables

View Source
var (
	ERR_ROOT_NODE_NOT_EXIST        = errors.New("Root node is not exist")
	ERR_NODE_NOT_EXIST             = errors.New("The node is not exist")
	ERR_RELATIONSHIP_EXIST_ALREADY = errors.New("The relationship is exist already")
	ERR_CACHE_KEY_NOT_EXIST        = errors.New("The key is not exist")
	ERR_RE_INDEX                   = errors.New("The data is running reindex.")
	ERR_NODE_LEVEL_IS_ZERO         = errors.New("Node 's level must be not  zero.")
	ERR_PERMISSION_DENY            = errors.New("Permission deny.")
	ERR_ASSERTION                  = errors.New("Assertion error.")
)

Functions

func Begin

func Begin() *gorm.DB

func DB

func DB() *gorm.DB

Types

type Config

type Config struct {
	Log               string
	Mysql             *Mysql
	UserCacheSize     int64
	ResourceCacheSize int64
	GraphCacheSize    int64
}

Userd for Program

var Configs *Config

type ConfigFile

type ConfigFile struct {
	Log               string     `yaml:"log"`
	Mysql             *MysqlFile `yaml:"mysql"`
	UserCacheSize     int64      `yaml:"user_cache_size"`
	ResourceCacheSize int64      `yaml:"resource_cache_size"`
	GraphCacheSize    int64      `yaml:"graph_cache_size"`
}

Parse Yaml File

type ConfigFileAll

type ConfigFileAll struct {
	TestFile    *ConfigFile `yaml:"test"`
	DebugFile   *ConfigFile `yaml:"debug"`
	ReleaseFile *ConfigFile `yaml:"release"`
}

type DBLog

type DBLog struct{}

func (*DBLog) Print

func (dblog *DBLog) Print(v ...interface{})

type Mysql

type Mysql struct {
	User         string
	Pass         string
	Db           string
	Protocol     string
	Address      string
	Params       string
	MaxOpenConns int64
	MaxIdleConns int64
}

type MysqlFile

type MysqlFile struct {
	User         string `yaml:"user"`
	Pass         string `yaml:"pass"`
	Db           string `yaml:"db"`
	Protocol     string `yaml:"protocol"`
	Address      string `yaml:"address"`
	Params       string `yaml:"params"`
	MaxOpenConns int64  `yaml:"max_open_conns"`
	MaxIdleConns int64  `yaml:"max_idle_conns"`
}

Jump to

Keyboard shortcuts

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