Documentation
¶
Index ¶
- Variables
- func APIKeyAuthMiddleware(apiKey string) gin.HandlerFunc
- func APIKeyOrTenantJWTAuthMiddleware(apiKey string, jwtKey string) gin.HandlerFunc
- func AbortWithError(c *gin.Context, code int, err error)
- func AbortWithValidationError(c *gin.Context, err error)
- func ErrorHandlerMiddleware(logger *otelzap.Logger) gin.HandlerFunc
- func MetricsMiddleware() gin.HandlerFunc
- func NewRouter(cfg RouterConfig, logger *otelzap.Logger, redisClient *redis.Client, ...) http.Handler
- func RequireTenantMiddleware(logger *otelzap.Logger, entityStore models.EntityStore) gin.HandlerFunc
- type APIService
- type CreateDestinationRequest
- type DestinationHandlers
- func (h *DestinationHandlers) Create(c *gin.Context)
- func (h *DestinationHandlers) Delete(c *gin.Context)
- func (h *DestinationHandlers) Disable(c *gin.Context)
- func (h *DestinationHandlers) Enable(c *gin.Context)
- func (h *DestinationHandlers) List(c *gin.Context)
- func (h *DestinationHandlers) Retrieve(c *gin.Context)
- func (h *DestinationHandlers) Update(c *gin.Context)
- type ErrorResponse
- type LogHandlers
- type PublishHandlers
- type PublishedEvent
- type RouterConfig
- type TenantHandlers
- type TopicHandlers
- type UpdateDestinationRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var JWT = jsonwebtoken{}
Functions ¶
func APIKeyAuthMiddleware ¶
func APIKeyAuthMiddleware(apiKey string) gin.HandlerFunc
func APIKeyOrTenantJWTAuthMiddleware ¶
func APIKeyOrTenantJWTAuthMiddleware(apiKey string, jwtKey string) gin.HandlerFunc
func ErrorHandlerMiddleware ¶
func ErrorHandlerMiddleware(logger *otelzap.Logger) gin.HandlerFunc
func MetricsMiddleware ¶
func MetricsMiddleware() gin.HandlerFunc
func NewRouter ¶
func NewRouter( cfg RouterConfig, logger *otelzap.Logger, redisClient *redis.Client, deliveryMQ *deliverymq.DeliveryMQ, entityStore models.EntityStore, logStore models.LogStore, publishmqEventHandler publishmq.EventHandler, ) http.Handler
func RequireTenantMiddleware ¶
func RequireTenantMiddleware(logger *otelzap.Logger, entityStore models.EntityStore) gin.HandlerFunc
Types ¶
type APIService ¶
type APIService struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*APIService) SubscribePublishMQ ¶
func (s *APIService) SubscribePublishMQ(ctx context.Context, subscription mqs.Subscription, eventHandler publishmq.EventHandler, concurrency int)
type CreateDestinationRequest ¶
type CreateDestinationRequest struct { ID string `json:"id" binding:"-"` Type string `json:"type" binding:"required"` Topics models.Topics `json:"topics" binding:"required"` Config map[string]string `json:"config" binding:"required"` Credentials map[string]string `json:"credentials" binding:"-"` }
func (*CreateDestinationRequest) ToDestination ¶
func (r *CreateDestinationRequest) ToDestination(tenantID string) models.Destination
type DestinationHandlers ¶
type DestinationHandlers struct {
// contains filtered or unexported fields
}
func NewDestinationHandlers ¶
func NewDestinationHandlers(logger *otelzap.Logger, entityStore models.EntityStore, topics []string) *DestinationHandlers
func (*DestinationHandlers) Create ¶
func (h *DestinationHandlers) Create(c *gin.Context)
func (*DestinationHandlers) Delete ¶
func (h *DestinationHandlers) Delete(c *gin.Context)
func (*DestinationHandlers) Disable ¶
func (h *DestinationHandlers) Disable(c *gin.Context)
func (*DestinationHandlers) Enable ¶
func (h *DestinationHandlers) Enable(c *gin.Context)
func (*DestinationHandlers) List ¶
func (h *DestinationHandlers) List(c *gin.Context)
func (*DestinationHandlers) Retrieve ¶
func (h *DestinationHandlers) Retrieve(c *gin.Context)
func (*DestinationHandlers) Update ¶
func (h *DestinationHandlers) Update(c *gin.Context)
type ErrorResponse ¶
type ErrorResponse struct { Err error `json:"-"` Code int `json:"-"` Message string `json:"message"` Data interface{} `json:"data,omitempty"` }
func NewErrBadRequest ¶
func NewErrBadRequest(err error) ErrorResponse
func NewErrInternalServer ¶
func NewErrInternalServer(err error) ErrorResponse
func (ErrorResponse) Error ¶
func (e ErrorResponse) Error() string
func (*ErrorResponse) Parse ¶
func (e *ErrorResponse) Parse(err error)
type LogHandlers ¶
type LogHandlers struct {
// contains filtered or unexported fields
}
func NewLogHandlers ¶
func NewLogHandlers( logger *otelzap.Logger, logStore models.LogStore, ) *LogHandlers
func (*LogHandlers) ListDeliveryByEvent ¶
func (h *LogHandlers) ListDeliveryByEvent(c *gin.Context)
TODO: consider authz where eventID doesn't belong to tenantID?
func (*LogHandlers) ListEvent ¶
func (h *LogHandlers) ListEvent(c *gin.Context)
func (*LogHandlers) RetrieveEvent ¶
func (h *LogHandlers) RetrieveEvent(c *gin.Context)
type PublishHandlers ¶
type PublishHandlers struct {
// contains filtered or unexported fields
}
func NewPublishHandlers ¶
func NewPublishHandlers( logger *otelzap.Logger, eventHandler publishmq.EventHandler, ) *PublishHandlers
func (*PublishHandlers) Ingest ¶
func (h *PublishHandlers) Ingest(c *gin.Context)
type PublishedEvent ¶
type PublishedEvent struct { ID string `json:"id"` TenantID string `json:"tenant_id"` DestinationID string `json:"destination_id"` Topic string `json:"topic"` EligibleForRetry bool `json:"eligible_for_retry"` Time time.Time `json:"time"` Metadata map[string]string `json:"metadata"` Data map[string]interface{} `json:"data"` }
TODO: validation
type RouterConfig ¶
type TenantHandlers ¶
type TenantHandlers struct {
// contains filtered or unexported fields
}
func NewTenantHandlers ¶
func NewTenantHandlers( logger *otelzap.Logger, jwtSecret string, entityStore models.EntityStore, ) *TenantHandlers
func (*TenantHandlers) Delete ¶
func (h *TenantHandlers) Delete(c *gin.Context)
func (*TenantHandlers) Retrieve ¶
func (h *TenantHandlers) Retrieve(c *gin.Context)
func (*TenantHandlers) RetrievePortal ¶
func (h *TenantHandlers) RetrievePortal(c *gin.Context)
func (*TenantHandlers) Upsert ¶
func (h *TenantHandlers) Upsert(c *gin.Context)
type TopicHandlers ¶
type TopicHandlers struct {
// contains filtered or unexported fields
}
func NewTopicHandlers ¶
func NewTopicHandlers(logger *otelzap.Logger, topics []string) *TopicHandlers
func (*TopicHandlers) List ¶
func (h *TopicHandlers) List(c *gin.Context)
Click to show internal directories.
Click to hide internal directories.