Documentation ¶
Index ¶
- Variables
- func Bool(b bool) *bool
- func CronSend(spec string, stream string)
- func Float32(f float32) *float32
- func Float64(f float64) *float64
- func Handler(stream string, call Call, opts ...Option)
- func Int(i int) *int
- func Int32(i int32) *int32
- func Int64(i int64) *int64
- func Listen()
- func Receive(rctx Rctx)
- func Send(stream string, msg map[string]interface{}) error
- func SendWithDelay(stream string, msg map[string]interface{}, delay time.Duration) error
- func SendWithTime(stream string, msg map[string]interface{}, datetime time.Time) error
- func SetDefault(rcli *redis.Client, configs ...Config)
- func SetDefaultByClient(client Client)
- func Shutdown()
- func Start()
- func String(s string) *string
- func Time(t time.Time) *time.Time
- func ToMap(data interface{}) map[string]interface{}
- type Call
- type Client
- type Config
- type Context
- type H
- type Msg
- type Option
- type Options
- type Rctx
- type ReceiveConfig
- type SenderConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultPrefix = "RS_" DefaultReceiveCfg = ReceiveConfig{ Work: Int(10), ReadCount: Int64(20), BlockTime: time.Second * 15, MaxRetries: Int64(3), Timeout: time.Second * 300, ZRangeInterval: time.Millisecond * 500, } DefaultSenderConfig = SenderConfig{MaxLen: Int64(2048)} )
Functions ¶
func SendWithDelay ¶
func SendWithTime ¶
func SetDefault ¶
func SetDefault(rcli *redis.Client, configs ...Config)
func SetDefaultByClient ¶
func SetDefaultByClient(client Client)
Types ¶
type Client ¶
type Client interface { Send(stream string, msg map[string]interface{}) error SendWithDelay(stream string, msg map[string]interface{}, delay time.Duration) error SendWithTime(stream string, msg map[string]interface{}, datetime time.Time) error CronSend(spec string, stream string) Handler(stream string, call Call, opts ...Option) Receive(rctx Rctx) Listen() Shutdown() Start() }
type Config ¶
type Config struct { Prefix string `json:"prefix"` Sender SenderConfig `json:"sender"` Receive ReceiveConfig `json:"receive"` }
type Option ¶
type Option struct {
F func(o *Options)
}
func WithBlockTime ¶
func WithMaxRetries ¶
func WithReadCount ¶
func WithTimeout ¶
type Options ¶
type ReceiveConfig ¶
type SenderConfig ¶
type SenderConfig struct {
MaxLen *int64 `json:"maxLen"`
}
Click to show internal directories.
Click to hide internal directories.