Documentation ¶
Index ¶
- Constants
- func CallbackSetUserID(data interface{}, req *Request)
- func CreateTopicsIfNotExist(ca sarama.ClusterAdmin, cl sarama.Client, topics []string) error
- func DefaultSaramaConfig(username, password string) *sarama.Config
- func PathBase(path string) string
- func SetVerbosity(b bool)
- func TopicMismatch(cl sarama.Client, topics []string) (bool, error)
- type AuthenticatorCallback
- type AuthenticatorFunc
- type Consumer
- func (c *Consumer) Cleanup(sarama.ConsumerGroupSession) error
- func (c *Consumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
- func (c *Consumer) Setup(sarama.ConsumerGroupSession) error
- func (c *Consumer) StartListening(ctxx context.Context) error
- func (c *Consumer) ToggleConsumption()
- type ConsumerConfig
- type ConsumerHandler
- type Event
- type EventType
- type Filter
- type KafkaContextKey
- type Producer
- type ProducerConfig
- type Request
- type Response
- type Router
- func (r *Router) CONNECT(pattern string, svc Service)
- func (r *Router) DELETE(pattern string, svc Service)
- func (r *Router) GET(pattern string, svc Service)
- func (r *Router) Group(pattern string) *RouterGroup
- func (r *Router) HEAD(pattern string, svc Service)
- func (r Router) Lookup(method, path string) (Service, string, map[string]string, bool)
- func (r *Router) OPTIONS(pattern string, svc Service)
- func (r *Router) PATCH(pattern string, svc Service)
- func (r *Router) POST(pattern string, svc Service)
- func (r *Router) PUT(pattern string, svc Service)
- func (r Router) Params(req Request) map[string]string
- func (r Router) Pattern(req Request) string
- func (r *Router) Register(method, pattern string, svc Service)
- func (r Router) Serve() Service
- func (r *Router) TRACE(pattern string, svc Service)
- type RouterGroup
- func (r *RouterGroup) CONNECT(pattern string, svc Service)
- func (r *RouterGroup) DELETE(pattern string, svc Service)
- func (r *RouterGroup) GET(pattern string, svc Service)
- func (r *RouterGroup) HEAD(pattern string, svc Service)
- func (r *RouterGroup) OPTIONS(pattern string, svc Service)
- func (r *RouterGroup) PATCH(pattern string, svc Service)
- func (r *RouterGroup) POST(pattern string, svc Service)
- func (r *RouterGroup) PUT(pattern string, svc Service)
- func (r *RouterGroup) Register(method, pattern string, svc Service)
- func (r *RouterGroup) TRACE(pattern string, svc Service)
- type ServeOptions
- type Server
- type Service
Constants ¶
View Source
const (
KafkaClusterVersion = "2.1.1"
)
Variables ¶
This section is empty.
Functions ¶
func CallbackSetUserID ¶
func CallbackSetUserID(data interface{}, req *Request)
CallbackSetUserID is a generic callback func that assumes the data provided is a string, and sets that string to a UserID header.
func CreateTopicsIfNotExist ¶
func DefaultSaramaConfig ¶
func SetVerbosity ¶
func SetVerbosity(b bool)
Types ¶
type AuthenticatorCallback ¶
type AuthenticatorCallback func(data interface{}, req *Request)
type AuthenticatorFunc ¶
type Consumer ¶
type Consumer struct { Configuration *ConsumerConfig // contains filtered or unexported fields }
func NewConsumer ¶
func NewConsumer(cfg *ConsumerConfig, handler ConsumerHandler) (*Consumer, error)
func (*Consumer) ConsumeClaim ¶
func (c *Consumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
func (*Consumer) ToggleConsumption ¶
func (c *Consumer) ToggleConsumption()
type ConsumerConfig ¶
type ConsumerConfig struct { Username string Password string Brokers []string Topics []string Group string Assignor string InitialOffsetOldest bool // contains filtered or unexported fields }
func (*ConsumerConfig) Sarama ¶
func (c *ConsumerConfig) Sarama() *sarama.Config
type ConsumerHandler ¶
type ConsumerHandler func(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
type Event ¶
type Event struct { Type EventType `json:"type"` Message interface{} `json:"message"` }
type Filter ¶
func FilterAuthenticate ¶
func FilterAuthenticate(a AuthenticatorFunc, c AuthenticatorCallback) Filter
FilterAuthenticateAndSetUserData returns a filter function that takes in an authenticator func and a callback func. The authenticator should use the authenticate the request, and either return nil interface to return a 403, or an error to return a 500.
func FilterAuthenticateAndSetUserID ¶
func FilterAuthenticateAndSetUserID(a AuthenticatorFunc) Filter
type KafkaContextKey ¶
type KafkaContextKey struct{}
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
func NewProducer ¶
func NewProducer(cfg *ProducerConfig) (*Producer, error)
func (*Producer) Messages ¶
func (p *Producer) Messages() chan *sarama.ProducerMessage
func (*Producer) StartListening ¶
type ProducerConfig ¶
type ProducerConfig struct { Username string Password string Brokers []string // contains filtered or unexported fields }
func (*ProducerConfig) Sarama ¶
func (c *ProducerConfig) Sarama() *sarama.Config
type Response ¶
type Response struct { fasthttp.Response Request *Request // contains filtered or unexported fields }
func FilterAttachTraceID ¶
func NewResponse ¶
func NewResponseWithCode ¶
func (*Response) FromConnect ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) Group ¶
func (r *Router) Group(pattern string) *RouterGroup
type RouterGroup ¶
type RouterGroup struct { Pattern string // contains filtered or unexported fields }
func (*RouterGroup) CONNECT ¶
func (r *RouterGroup) CONNECT(pattern string, svc Service)
func (*RouterGroup) DELETE ¶
func (r *RouterGroup) DELETE(pattern string, svc Service)
func (*RouterGroup) GET ¶
func (r *RouterGroup) GET(pattern string, svc Service)
func (*RouterGroup) HEAD ¶
func (r *RouterGroup) HEAD(pattern string, svc Service)
func (*RouterGroup) OPTIONS ¶
func (r *RouterGroup) OPTIONS(pattern string, svc Service)
func (*RouterGroup) PATCH ¶
func (r *RouterGroup) PATCH(pattern string, svc Service)
func (*RouterGroup) POST ¶
func (r *RouterGroup) POST(pattern string, svc Service)
func (*RouterGroup) PUT ¶
func (r *RouterGroup) PUT(pattern string, svc Service)
func (*RouterGroup) Register ¶
func (r *RouterGroup) Register(method, pattern string, svc Service)
func (*RouterGroup) TRACE ¶
func (r *RouterGroup) TRACE(pattern string, svc Service)
type ServeOptions ¶
type ServeOptions struct {
// contains filtered or unexported fields
}
func DefaultServeOptions ¶
func DefaultServeOptions() *ServeOptions
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) RegisterShutdownFunc ¶
func (*Server) Serve ¶
func (s *Server) Serve(svc Service, opt *ServeOptions)
Serves both HTTP and gRPC
Source Files ¶
Click to show internal directories.
Click to hide internal directories.