Documentation ¶
Index ¶
- Constants
- func ForeachAPIProcessor(h func(p APIProcessor) bool)
- func SetAPIProcessor(p APIProcessor)
- type APIConsumer
- func (c *APIConsumer) GetCfg() config.Dendrite
- func (c *APIConsumer) GetRpcCli() *common.RpcClient
- func (c *APIConsumer) Init(name string, ud interface{}, topic string)
- func (c *APIConsumer) InitGroup(name string, ud interface{}, topic, grp string)
- func (c *APIConsumer) OnMessage(ctx context.Context, topic string, partition int32, data []byte) []byte
- func (c *APIConsumer) RegisterHandler(msgType int32, p APIProcessor)
- func (c *APIConsumer) SetupTransport()
- func (c *APIConsumer) Start()
- type APIEvent
- type APIProcessor
Constants ¶
View Source
const ( APITypeMin int8 = iota APITypeAuth APITypeExternal APITypeInternal APITypeInternalAuth APITypeDownload APITypeUpload APITypeFed APITypeMax )
Variables ¶
This section is empty.
Functions ¶
func ForeachAPIProcessor ¶
func ForeachAPIProcessor(h func(p APIProcessor) bool)
func SetAPIProcessor ¶
func SetAPIProcessor(p APIProcessor)
Types ¶
type APIConsumer ¶
type APIConsumer struct { Cfg config.Dendrite RpcCli *common.RpcClient // contains filtered or unexported fields }
func (*APIConsumer) GetCfg ¶
func (c *APIConsumer) GetCfg() config.Dendrite
func (*APIConsumer) GetRpcCli ¶
func (c *APIConsumer) GetRpcCli() *common.RpcClient
func (*APIConsumer) Init ¶
func (c *APIConsumer) Init(name string, ud interface{}, topic string)
func (*APIConsumer) InitGroup ¶
func (c *APIConsumer) InitGroup(name string, ud interface{}, topic, grp string)
func (*APIConsumer) RegisterHandler ¶
func (c *APIConsumer) RegisterHandler(msgType int32, p APIProcessor)
func (*APIConsumer) SetupTransport ¶
func (c *APIConsumer) SetupTransport()
func (*APIConsumer) Start ¶
func (c *APIConsumer) Start()
type APIProcessor ¶
type APIProcessor interface { GetRoute() string GetMetricsName() string GetMsgType() int32 GetAPIType() int8 GetMethod() []string GetTopic(cft *config.Dendrite) string NewRequest() core.Coder FillRequest(coder core.Coder, req *http.Request, vars map[string]string) error NewResponse(code int) core.Coder // GetPath valid: r0 v1 inr0 sys unstable mediaR0 mediaV1 fedV1 GetPrefix() []string Process(ctx context.Context, ud interface{}, msg core.Coder, device *authtypes.Device) (int, core.Coder) }
func GetAPIProcessor ¶
func GetAPIProcessor(msgType int32) APIProcessor
Click to show internal directories.
Click to hide internal directories.