Documentation ¶
Index ¶
- Variables
- func Plugin(ctx context.Context, client *wkafka.Client, config interface{}) error
- func PluginWithName() (string, wkafka.PluginFunc)
- type Config
- type DLQRecord
- type Error
- type Handler
- func (h *Handler) Event(w http.ResponseWriter, r *http.Request)
- func (h *Handler) File() (http.Handler, error)
- func (h *Handler) Handler() (string, http.Handler)
- func (h *Handler) Info(w http.ResponseWriter, _ *http.Request)
- func (h *Handler) Serve(ctx context.Context) error
- func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SkipDLQ(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SkipSet(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SkipUpdate(w http.ResponseWriter, r *http.Request)
- func (h *Handler) StartPubSub(ctx context.Context) error
- func (h *Handler) TriggerInfo()
- func (h *Handler) UI() (http.Handler, error)
- type Header
- type InfoResponse
- type Option
- type PubSubConfig
- type PubSubModel
- type PubSubModelPublish
- type Redis
- type RedisConfig
- type RegexCacheStore
- type RegexPathStore
- type Response
- type SkipDLQRequest
- type SkipRequest
Constants ¶
This section is empty.
Variables ¶
var PluginName = "handler"
Functions ¶
func PluginWithName ¶ added in v0.3.6
func PluginWithName() (string, wkafka.PluginFunc)
Types ¶
type Config ¶ added in v0.3.6
type Config struct { Enabled bool `cfg:"enabled" json:"enabled"` Addr string `cfg:"addr" json:"addr"` PathPrefix string `cfg:"path_prefix" json:"path_prefix"` PubSub *PubSubConfig `cfg:"pubsub" json:"pubsub"` }
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
@Title wkafka API @BasePath /wkafka/ @description Kafka library
func (*Handler) Event ¶ added in v0.3.5
func (h *Handler) Event(w http.ResponseWriter, r *http.Request)
func (*Handler) Info ¶ added in v0.3.4
func (h *Handler) Info(w http.ResponseWriter, _ *http.Request)
Info returns the current information of the client. @Summary Get the current information of the client. @Tags wkafka @Success 200 {object} InfoResponse @Router /v1/info [GET]
func (*Handler) ServeHTTP ¶ added in v0.3.5
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*Handler) SkipDLQ ¶ added in v0.3.6
func (h *Handler) SkipDLQ(w http.ResponseWriter, r *http.Request)
@Summary Skip on DLQ topic. @Tags wkafka @Accept json @Produce json @Param skip body SkipDLQRequest true "skip" @Success 200 {object} Response @Router /v1/skip-dlq [PATCH]
func (*Handler) SkipSet ¶ added in v0.3.5
func (h *Handler) SkipSet(w http.ResponseWriter, r *http.Request)
@Summary Set the skip. @Tags wkafka @Accept json @Produce json @Param skip body SkipRequest true "skip" @Success 200 {object} Response @Router /v1/skip [PUT]
func (*Handler) SkipUpdate ¶ added in v0.3.5
func (h *Handler) SkipUpdate(w http.ResponseWriter, r *http.Request)
@Summary Patch the skip. @Tags wkafka @Accept json @Produce json @Param skip body SkipRequest true "skip" @Success 200 {object} Response @Router /v1/skip [PATCH]
func (*Handler) StartPubSub ¶ added in v0.3.6
func (*Handler) TriggerInfo ¶ added in v0.3.5
func (h *Handler) TriggerInfo()
type InfoResponse ¶ added in v0.3.5
type Option ¶ added in v0.3.2
type Option func(*option)
func WithAddr ¶ added in v0.3.6
WithAddr to set address for handler.
- Only for Serve method, default is ":17070".
func WithPathPrefix ¶ added in v0.3.5
WithPathPrefix to set prefix path for handler.
func WithPubSub ¶ added in v0.3.6
func WithPubSub(cfg *PubSubConfig) Option
WithPubSub to set pubsub configuration.
type PubSubConfig ¶ added in v0.3.6
type PubSubConfig struct { Prefix string `cfg:"prefix" json:"prefix"` Redis *RedisConfig `cfg:"redis" json:"redis"` }
type PubSubModel ¶ added in v0.3.6
type PubSubModel struct { Type string `json:"type"` Value json.RawMessage `json:"value"` }
type PubSubModelPublish ¶ added in v0.3.6
type PubSubModelPublish struct { Type string `json:"type"` Value interface{} `json:"value"` }
type Redis ¶ added in v0.3.6
type Redis struct {
// contains filtered or unexported fields
}
type RedisConfig ¶ added in v0.3.6
type RegexCacheStore ¶ added in v0.3.5
type RegexPathStore ¶ added in v0.3.5
type SkipDLQRequest ¶ added in v0.3.6
type SkipDLQRequest map[int32]wkafka.OffsetConfig
type SkipRequest ¶ added in v0.3.5
type SkipRequest map[string]map[int32]wkafka.OffsetConfig