values

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 4 Imported by: 8

Documentation

Index

Constants

View Source
const (
	BytesEmptyJson = "null"
)
View Source
const MaxBitwiseUnit = 32
View Source
const MessageErrorCodeDefault int = 9999

Variables

This section is empty.

Functions

This section is empty.

Types

type Attach

type Attach string

func (*Attach) Marshal

func (a *Attach) Marshal(v interface{}) error

Marshal 将一个对象放入Attach TODO len(*a) == 0

func (*Attach) MarshalJSON

func (a *Attach) MarshalJSON() ([]byte, error)

func (*Attach) Unmarshal

func (a *Attach) Unmarshal(i interface{}) error

Unmarshal 使用i解析Attach

func (*Attach) UnmarshalJSON

func (a *Attach) UnmarshalJSON(b2 []byte) error

type Bitwise

type Bitwise []Byte

func (*Bitwise) Delete

func (m *Bitwise) Delete(bit int)

Delete bit位设置为0

func (*Bitwise) Has

func (m *Bitwise) Has(bit int) bool

Has bit位是否设置值

func (*Bitwise) Set

func (m *Bitwise) Set(bit int)

Set bit位设置为1

type Byte added in v0.0.2

type Byte uint32

func (*Byte) Delete added in v0.0.2

func (m *Byte) Delete(bit int)

Delete bit位设置为0

func (*Byte) Has added in v0.0.2

func (m *Byte) Has(bit int) (r bool)

Has bit位是否设置值

func (*Byte) Set added in v0.0.2

func (m *Byte) Set(bit int)

Set bit位设置为1

type Bytes added in v0.0.2

type Bytes []byte

func (*Bytes) Marshal added in v0.0.2

func (b *Bytes) Marshal(v interface{}) error

func (*Bytes) MarshalJSON added in v0.0.2

func (b *Bytes) MarshalJSON() ([]byte, error)

func (*Bytes) Unmarshal added in v0.0.2

func (b *Bytes) Unmarshal(i interface{}) error

func (*Bytes) UnmarshalJSON added in v0.0.2

func (b *Bytes) UnmarshalJSON(v []byte) error

type Message

type Message struct {
	Code int   `json:"code"`
	Data Bytes `json:"data"`
}

func Error

func Error(err any) (r *Message)

func Errorf

func Errorf(code int, format any, args ...any) (r *Message)

func Parse

func Parse(v any) *Message

func (*Message) Error

func (this *Message) Error() string

func (*Message) Format added in v0.0.4

func (this *Message) Format(code int, format any, args ...any)

Format 格式化一个错误,必定产生错误码

func (*Message) Marshal added in v0.0.2

func (this *Message) Marshal(v interface{}) error

func (*Message) Parse

func (this *Message) Parse(v interface{}) *Message

func (*Message) String added in v0.0.2

func (this *Message) String() string

func (*Message) Unmarshal added in v0.0.2

func (this *Message) Unmarshal(i interface{}) error

Unmarshal 如果是一个错误信息 应当单独处理

type Values

type Values map[string]interface{}

func (Values) Get

func (m Values) Get(key string) interface{}

func (Values) GetFloat32

func (m Values) GetFloat32(key string) float32

func (Values) GetFloat64

func (m Values) GetFloat64(key string) (r float64)

func (Values) GetInt

func (m Values) GetInt(key string) int

func (Values) GetInt32

func (m Values) GetInt32(key string) int32

func (Values) GetInt64

func (m Values) GetInt64(key string) int64

func (Values) GetString

func (m Values) GetString(key string) (r string)

func (Values) Has

func (m Values) Has(key string) bool

func (Values) Set

func (m Values) Set(key string, val interface{}) interface{}

Jump to

Keyboard shortcuts

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