Documentation
¶
Index ¶
- Variables
- func CallbackHandler(ctx context.Context, r *http.Request) (err error)
- func Init(redisCli *redis.Client, cfg *Config) (err error)
- func ToSync[Req ReqI, CallbackData any](ctx context.Context, req Req, async func(context.Context, Req) error, ...) (data CallbackData, err error)
- type CallbackInfo
- type CallbackInfoParsed
- type Client
- type Config
- type Messager
- type Option
- type ReqI
- type WaiterInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidSign = errors.New("invalid sign")
Functions ¶
Types ¶
type CallbackInfo ¶
type CallbackInfoParsed ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CallbackHandler ¶
func (*Client) Release ¶
func (c *Client) Release(info *WaiterInfo)
type Config ¶
type Config struct { CallbackURL string `json:"callback_url" yaml:"callback_url" validate:"url"` // 回调地址 MaxCallbackBytes int64 `json:"max_callback_bytes" yaml:"max_callback_bytes" validate:"gt=0"` // 回调body限制 Stream string `json:"stream" yaml:"stream" validate:"gt=0"` // 回调stream key TimeoutSeconds int `json:"timeout_seconds" yaml:"timeout_seconds" validate:"gt=0"` // 超时时间 }
type WaiterInfo ¶
type WaiterInfo struct { AsyncID string State string ResultC chan *CallbackInfoParsed }
Click to show internal directories.
Click to hide internal directories.