values

package
v0.0.0-...-70e99ff Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.

Index

Constants

View Source
const (
	Int = iota
	Int64
	Float32
	Float64
	String
	Bool
	SliceByte
)

Variables

View Source
var (
	ERR_KEY_EXIST         = errors.New("key exist")
	ERR_KEY_NOT_EXIST     = errors.New("key not exist")
	ERR_KEY_INVALID_TYPE  = errors.New("key invalid type")
	ERR_KEY_INVALID_VALUE = errors.New("key invalid value")
)

Functions

func ValueTypesConvertNameToType

func ValueTypesConvertNameToType(t string) (uint8, error)

func ValueTypesString

func ValueTypesString(t uint8) (string, error)

Types

type IteratorFunc

type IteratorFunc func(key string, value *ValueTypes, err error) error

type Value

type Value struct {
	S     map[string]*ValueTypes `json:"val"`
	Mutex sync.RWMutex           `json:"-"`
}

func New

func New() *Value

func (*Value) Delete

func (b *Value) Delete(key string) (ok bool, err error)

func (*Value) GetBool

func (b *Value) GetBool(key string) (val bool, exist bool, err error)

func (*Value) GetBytes

func (b *Value) GetBytes(key string) (val []byte, exist bool, err error)

func (*Value) GetFloat32

func (b *Value) GetFloat32(key string) (val float32, exist bool, err error)

func (*Value) GetFloat64

func (b *Value) GetFloat64(key string) (val float64, exist bool, err error)

func (*Value) GetInt

func (b *Value) GetInt(key string) (val int, exist bool, err error)

func (*Value) GetInt64

func (b *Value) GetInt64(key string) (val int64, exist bool, err error)

func (*Value) GetInterface

func (b *Value) GetInterface(key string, val interface{}) (ok bool, err error)

func (*Value) GetString

func (b *Value) GetString(key string) (val string, exist bool, err error)

func (*Value) IsKeyExist

func (b *Value) IsKeyExist(key string) bool

func (*Value) Iterator

func (b *Value) Iterator(fn IteratorFunc) error

func (Value) MarshalEasyJSON

func (v Value) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Value) MarshalJSON

func (v Value) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Value) SetBool

func (b *Value) SetBool(key string, val bool) (err error)

func (*Value) SetBytes

func (b *Value) SetBytes(key string, val []byte) (err error)

func (*Value) SetFloat32

func (b *Value) SetFloat32(key string, val float32) (err error)

func (*Value) SetFloat64

func (b *Value) SetFloat64(key string, val float64) (err error)

func (*Value) SetInt

func (b *Value) SetInt(key string, val int) (err error)

func (*Value) SetInt64

func (b *Value) SetInt64(key string, val int64) (err error)

func (*Value) SetInterface

func (b *Value) SetInterface(key string, val interface{}) (err error)

func (*Value) SetString

func (b *Value) SetString(key string, val string) (err error)

func (*Value) UnmarshalEasyJSON

func (v *Value) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Value) UnmarshalJSON

func (v *Value) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Value) UpBool

func (b *Value) UpBool(key string, val bool) (err error)

func (*Value) UpBytes

func (b *Value) UpBytes(key string, val []byte) (err error)

func (*Value) UpFloat32

func (b *Value) UpFloat32(key string, val float32) (err error)

func (*Value) UpFloat64

func (b *Value) UpFloat64(key string, val float64) (err error)

func (*Value) UpInt

func (b *Value) UpInt(key string, val int) (err error)

func (*Value) UpInt64

func (b *Value) UpInt64(key string, val int64) (err error)

func (*Value) UpInterface

func (b *Value) UpInterface(key string, val interface{}) (err error)

func (*Value) UpString

func (b *Value) UpString(key string, val string) (err error)

type ValueTypes

type ValueTypes struct {
	Type  uint8       `json:"t"`
	Value interface{} `json:"d"`
}

func (*ValueTypes) Cast

func (b *ValueTypes) Cast() (*ValueTypes, error)

Jump to

Keyboard shortcuts

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