comm

package
v0.0.0-...-c5b1684 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: MulanPSL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PathPrefix : / or \\
	PathPrefix = string(filepath.Separator)
	// YamlDir : .giteego
	YamlDir = ".giteego"
	// Repo : repo
	Repo = "repo"
	// Build : build
	Build = "build"
	// Jobs : jobs
	Jobs = "jobs"
	// Plugs : plugins
	Plugs = "plugins"
)
View Source
const StaticPkg = "" /* 15725808-byte string literal not displayed */

Variables

View Source
var (
	Port      int32
	Debugs    = false
	Installed = false
	Web       *gin.Engine
	//DBMain use getDB or get a new Session
	DBMain *dbcore.DBHelper
	//BCache bolt cache db
	BCache *bolt.DB
)
View Source
var (
	//BuildLimit
	BuildLimit = 10
	//ParseLimit
	ParseLimit = 10
)

Limit is Maximum number of coroutines default value

View Source
var KeyNotFoundErr = errors.New("key not found")
View Source
var KeyOutTimeErr = errors.New("key is timeout")
View Source
var WorkPath = ""

WorkPath is :server workpath

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func CacheFlush

func CacheFlush() error

func CacheGet

func CacheGet(key string) ([]byte, error)

func CacheGets

func CacheGets(key string, data interface{}) error

func CacheSet

func CacheSet(key string, data []byte, outm ...time.Duration) error

func CacheSets

func CacheSets(key string, data interface{}, outm ...time.Duration) error

func GetThirdApi

func GetThirdApi(s string, host string) (*thirdapi.Client, error)

func InitConf

func InitConf() (rterr error)

InitConf init conf

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type Conf

type Conf struct {
	ServerConf *Server         `yaml:"server" json:"server"`
	RunnerConf *Runner         `yaml:"runner" json:"runner"`
	DataConf   *DataSourceConf `yaml:"datasource" json:"datasource"`
}

Conf is main

var (
	//MainCfg yaml config
	MainCfg *Conf
)

type DataSourceConf

type DataSourceConf struct {
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	Database string `yaml:"database"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	ShowSQL  bool   `yaml:"showsql"`
}

DataSourceConf is DataSource

type Limit

type Limit struct {
	BuildLimit int `yaml:"build" json:"build"`
	ParseLimit int `yaml:"parse" json:"parse"`
}

Limit is Maximum number of coroutines

type MainRunnerConf

type MainRunnerConf struct {
	Enable    bool   `yaml:"enable"`
	Workspace string `yaml:"workspace"`
	Limit     int    `yaml:"limit"`
}

MainRunner conf

type Runner

type Runner struct {
	Port       string `yaml:"port" json:"port"`
	Secret     string `yaml:"secret" json:"secret"`
	MainRunner bool   `yaml:"main-runner" json:"main-runner"`
}

Runner conf

type Server

type Server struct {
	Host      string `yaml:"host"`
	Port      string `yaml:"port"`
	LoginKey  string `yaml:"login-key" json:"login-key"`
	WorkPath  string `yaml:"workspace" json:"workspace"`
	LimitConf *Limit `yaml:"limit" json:"limit"`
}

Server Conf

Directories

Path Synopsis
yml
dag

Jump to

Keyboard shortcuts

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