common

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseReq

type BaseReq struct {
	Context Context `json:"-"` // 這個字段不能修改偏移值 ⚠️ 必须保持第一位

	// 字符串字段(16字节)
	Cmd string `json:"cmd"`

	// 数值字段(8字节对齐)
	PrevID int64 `json:"prevID"`
	LastID int64 `json:"lastID"`
	Offset int64 `json:"offset"`
	Limit  int64 `json:"limit"`

	// bool字段(1字节)
	CountQ bool `json:"countQ"`
}

func GetBasePtrReq added in v1.0.146

func GetBasePtrReq(ptr uintptr) *BaseReq

func (BaseReq) MarshalEasyJSON added in v1.1.0

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (BaseReq) MarshalJSON added in v1.1.0

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

MarshalJSON supports json.Marshaler interface

func (*BaseReq) UnmarshalEasyJSON added in v1.1.0

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*BaseReq) UnmarshalJSON added in v1.1.0

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

UnmarshalJSON supports json.Unmarshaler interface

type Context

type Context struct {
	// 8字节字段组 (5个字段)
	Identify        *Identify                               // 8字节 - 指针字段
	System          *System                                 // 8字节 - 指针字段
	RedisCacheAware func(ds ...string) (cache.Cache, error) // 8字节 - 函数指针
	LocalCacheAware func(ds ...string) (cache.Cache, error) // 8字节 - 函数指针
	// 16字节字段组 (2个字段)
	Cipher map[int64]crypto.Cipher // 16字节 - slice
	Path   string                  // 16字节 - 字符串字段
}

type Identify added in v1.0.29

type Identify struct {
	// 接口字段(16字节)
	ID interface{}
}

func (*Identify) Int64 added in v1.0.29

func (s *Identify) Int64() int64

func (*Identify) ObjectID added in v1.0.29

func (s *Identify) ObjectID() primitive.ObjectID

func (*Identify) String added in v1.0.29

func (s *Identify) String() string

type System added in v1.0.116

type System struct {
	// 字符串字段(16字节对齐)
	Name    string // 系统名
	Version string // 系统版本
}

Jump to

Keyboard shortcuts

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