message

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiResponse added in v1.2.0

type ApiResponse struct {
	Data  interface{}     `json:"data"`
	Error errorcode.Value `json:"err"`
}

api响应结构

type ChangeValue added in v1.2.0

type ChangeValue struct {
	// 数值类型
	ValueType int `validate:"min=0,required"`
	// 目标编号 / 目标类型
	TargetNo, TargetType int `validate:"min=0"`
	// 数量,
	Count int64 `validate:"required"`
	// 来源
	Source string
}

变更数值

type DynamicApiResponse added in v1.2.0

type DynamicApiResponse[T any] struct {
	Data  T               `json:"data"`
	Error errorcode.Value `json:"err"`
}

动态api响应结构

func (DynamicApiResponse[T]) GetData added in v1.2.0

func (m DynamicApiResponse[T]) GetData() interface{}

获取数据

func (DynamicApiResponse[T]) GetErrorCode added in v1.2.0

func (m DynamicApiResponse[T]) GetErrorCode() errorcode.Value

获取错误码

type RedisGeoLocation

type RedisGeoLocation struct {
	RedisGeoPosition

	Distance float64
	Hash     int64
	Member   string
}

type RedisGeoPosition

type RedisGeoPosition struct {
	Latitude, Longitude float64
}

redis geo 坐标

type RedisGeoRadiusQuery

type RedisGeoRadiusQuery struct {
	Count     int
	Radius    float64
	Sort      string
	Unit      string
	WithCoord bool
	WithDist  bool
	WithHash  bool
}

redis geo半径查询

type RedisZMember

type RedisZMember struct {
	Score  float64
	Member string
}

type RedisZRangeByScore

type RedisZRangeByScore struct {
	Count, Offset int64
	WithScores    bool
}

type Reward added in v1.3.0

type Reward struct {
	ChangeValue `bson:",inline"`

	// 权重
	Weight int `validate:"min=1"`
}

奖励

type Route added in v1.2.0

type Route struct {
	Api      string `uri:"api"`
	Endpoint string `uri:"endpoint"`
}

type UserAuth added in v1.1.0

type UserAuth struct {
	From string
	ID   string
}

用户认证

Jump to

Keyboard shortcuts

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