comm

package
v0.0.0-...-5b1f977 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const DATASOURCE_DRIVER_MYSQL = "mysql"
View Source
const DATASOURCE_DRIVER_POSTGRES = "postgres"
View Source
const DATASOURCE_DRIVER_SQLITE = "sqlite"
View Source
const StaticPkg = "" /* 3349192-byte string literal not displayed */
View Source
const Version = "1.3.7"

Variables

View Source
var (
	Cfg       = Config{}
	Db        *xorm.Engine
	BCache    *bolt.DB
	WebEgn    *gin.Engine
	HbtpEgn   *hbtp.Engine
	IsMySQL   = false
	Installed = false
	NotUpPass = false
	WorkPath  = ""
	WebHost   = ""
)
View Source
var KeyNotFoundErr = errors.New("key not found")
View Source
var KeyOutTimeErr = errors.New("key is timeout")

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 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 Cancel

func Cancel()

func FindPage

func FindPage(ses *xorm.Session, ls interface{}, page int64, size ...int64) (*bean.Page, error)

func FindPages

func FindPages(gen *bean.PageGen, ls interface{}, page int64, size ...int64) (*bean.Page, error)

func GetThirdApi

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

Types

type Config

type Config struct {
	Server struct {
		Host      string   `yaml:"host"` //外网访问地址
		LoginKey  string   `yaml:"loginKey"`
		RunLimit  int      `yaml:"runLimit"`
		HbtpHost  string   `yaml:"hbtpHost"`
		Secret    string   `yaml:"secret"`
		Shells    []string `yaml:"shells"`
		DownToken string   `yaml:"DownToken"`
	} `yaml:"server"`
	Datasource struct {
		Driver string `yaml:"driver"`
		Url    string `yaml:"url"`
	} `yaml:"datasource"`
}

type SesFuncHandler

type SesFuncHandler = func(ses *xorm.Session)

Jump to

Keyboard shortcuts

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