safe

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

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