safe

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VOID = iota
	INT
	BOOL
	FLOAT
	STRING
	ARRAY
)

Variables

This section is empty.

Functions

func Mem added in v1.1.1

func Mem() error

Types

type Code added in v1.0.8

type Code struct {
	Data        []byte
	Consumption time.Duration
	Src         *[]byte
}

Code ..

func Decode32 added in v1.0.8

func Decode32(src *[]byte) *Code

func Encode32 added in v1.0.8

func Encode32(src *[]byte, flag FlagType) (*Code, error)

Encode32 ...

type FlagType added in v1.0.8

type FlagType uint8

FlagType ...

type Global

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

Global 只用于全局变量,考虑到全局变量可能存在竞态,所以加锁保护 全局变量的存在,可能导致同时写,或者一写一读的情况

func NewGlobal

func NewGlobal(v ...interface{}) *Global

NewGlobal 初始化一个新全局变量

func (*Global) Get

func (my *Global) Get() interface{}

Get get global value

func (*Global) GetBool

func (my *Global) GetBool() bool

GetBool get bool value

func (*Global) GetFloat

func (my *Global) GetFloat() (float64, error)

GetFloat get float64 value

func (*Global) GetInt

func (my *Global) GetInt() (int, error)

GetInt get int value

func (*Global) GetInt64

func (my *Global) GetInt64() (int64, error)

GetInt64 get int64 value

func (*Global) GetMap

func (my *Global) GetMap() *Map

GetMap get map value

func (*Global) Set

func (my *Global) Set(v interface{})

Set set global value

func (Global) String

func (my Global) String() string

type Map

type Map map[string]interface{}

Map 自定义map[string]interface{}类型,使其可以拥有方法

func (*Map) Get

func (my *Map) Get(key string) interface{}

Get get map value(map)

func (*Map) Set

func (my *Map) Set(key string, v interface{})

Set get map value (map[string]interface{})

Jump to

Keyboard shortcuts

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