core

package
v0.0.0-...-8019779 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBytes

func CheckBytes(b []byte) error

func DBKey

func DBKey(format string, a ...interface{}) []byte

func Decrypt

func Decrypt(password, data []byte) ([]byte, error)

func Encrypt

func Encrypt(password, data []byte) ([]byte, error)

func GetRandString

func GetRandString(length int) (string, error)

func IsRemoteFile

func IsRemoteFile(uri string) bool

func ReadFile

func ReadFile(uri string) ([]byte, error)

func StandradURI

func StandradURI(uri string) (string, error)

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

func GetConfig

func GetConfig() *Config

func (*Config) GetDBFile

func (p *Config) GetDBFile() string

func (*Config) GetSessionTimeout

func (p *Config) GetSessionTimeout() time.Duration

func (*Config) SetDBFile

func (p *Config) SetDBFile(dbFile string)

func (*Config) SetSessionTimeout

func (p *Config) SetSessionTimeout(sessionTimeout time.Duration)

type Context

type Context struct {
	// contains filtered or unexported fields
}

func NewRootContext

func NewRootContext(file string) (*Context, error)

func (*Context) GetLogItem

func (p *Context) GetLogItem() *LogItem

func (*Context) Report

func (p *Context) Report(kind LogKind, data []byte) bool

type DB

type DB struct {
	// contains filtered or unexported fields
}

func NewDB

func NewDB(absPath string) (*DB, error)

func (*DB) CreateBucketIsNotExist

func (p *DB) CreateBucketIsNotExist(name string) error

func (*DB) DeleteBucket

func (p *DB) DeleteBucket(name string) error

func (*DB) Get

func (p *DB) Get(bucketName string, key string) ([]byte, error)

func (*DB) GetBucketID

func (p *DB) GetBucketID(bucketName string) (uint64, error)

func (*DB) IsBucketExist

func (p *DB) IsBucketExist(name string) bool

func (*DB) Put

func (p *DB) Put(bucketName string, key string, value []byte) error

func (*DB) Search

func (p *DB) Search(bucketName string, prefix string) (map[string][]byte, error)

func (*DB) Update

func (p *DB) Update(fn func(tx *bolt.Tx) error) error

func (*DB) View

func (p *DB) View(fn func(tx *bolt.Tx) error) error

type DBManager

type DBManager struct {
	// contains filtered or unexported fields
}

func GetManager

func GetManager() *DBManager

func (*DBManager) GetDB

func (p *DBManager) GetDB(path string) (*DB, error)

type LogItem

type LogItem struct {
	// contains filtered or unexported fields
}

type LogKind

type LogKind int
const (
	LogKindInfo LogKind = iota
	LogKindOut
	LogKindError
	LogKindFatal
)

Jump to

Keyboard shortcuts

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