zweb

package
v1.9.9 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NilFound = errors.New("defaultFun未返回数据")

Functions

This section is empty.

Types

type Api added in v1.1.20200925

type Api interface {
	Register(*ghttp.Server)
}

type ApiBase

type ApiBase struct {
}

func (*ApiBase) Error

func (api *ApiBase) Error(msg string, err error) z.Map

func (*ApiBase) ErrorResult

func (api *ApiBase) ErrorResult(msg string, error error, r *ghttp.Request) error

func (*ApiBase) GetToken

func (api *ApiBase) GetToken(r *ghttp.Request) string

func (*ApiBase) Ok

func (api *ApiBase) Ok(data interface{}) z.Map

func (*ApiBase) OkResult

func (api *ApiBase) OkResult(data interface{}, r *ghttp.Request) error

func (*ApiBase) Result

func (api *ApiBase) Result(data interface{}, err error, r *ghttp.Request) error

func (*ApiBase) Result2 added in v1.0.5

func (api *ApiBase) Result2(result *z.Result, r *ghttp.Request) error

type RedisService added in v1.9.0

type RedisService struct {
	Redis *zredis.Redis
}

func (*RedisService) GetData added in v1.9.0

func (rs *RedisService) GetData(key string, result interface{}, duration time.Duration, defaultFun func() interface{}) (err error)

func (*RedisService) GetRidesData added in v1.9.0

func (rs *RedisService) GetRidesData(key string, v interface{}) error

func (*RedisService) Publish added in v1.9.0

func (rs *RedisService) Publish(channel string, data interface{})

func (*RedisService) SetRedisData added in v1.9.0

func (rs *RedisService) SetRedisData(key string, v interface{}, duration time.Duration)

func (*RedisService) Subscribe added in v1.9.0

func (rs *RedisService) Subscribe(channel string, receiver func(channel string, msg interface{}))

Jump to

Keyboard shortcuts

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