Documentation ¶
Index ¶
- Constants
- func NewMiddleware(logger *zerolog.Logger) []func(next http.Handler) http.Handler
- func NewMux(a *APIManager, middleware []func(next http.Handler) http.Handler) (http.Handler, error)
- func ProvideLogger(config config.Config) (*zerolog.Logger, error)
- func SetupAPIServer(lifecycle fx.Lifecycle, config config.Config, logger *zerolog.Logger, ...) error
- type APIManager
- type ApiError
- type BadRequestError
- type InternalServerError
- type InvalidOptionError
- type NotFoundError
- type NotImplementedError
- type Response
- type Status
- type Tenant
- type Tracing
Constants ¶
View Source
const ( LogTraceId = "tx.traceId" LogSpanId = "tx.spanId" LogParentSpanId = "tx.parentSpanId" LogChildSpanId = "tx.childSpanId" LogTenantId = "gears.app.id" )
Logging expected keys
View Source
const ( HeaderTraceId = "X-B3-TraceId" HeaderSpanId = "X-B3-SpanId" HeaderParentSpanId = "X-B3-ParentSpanId" HeaderTenantId = "Application-Id" )
API header expected keys
Variables ¶
This section is empty.
Functions ¶
func NewMiddleware ¶
func ProvideLogger ¶ added in v0.2.0
Types ¶
type APIManager ¶
type APIManager struct {
// contains filtered or unexported fields
}
func NewAPIManager ¶
func NewAPIManager(routingMgr tablemgr.RoutingTableManager, tenantStorer tenant.TenantStorer, quotaManager *quota.QuotaManager) (*APIManager, error)
type BadRequestError ¶ added in v0.2.0
type BadRequestError struct {
// contains filtered or unexported fields
}
func (*BadRequestError) Error ¶ added in v0.2.0
func (e *BadRequestError) Error() string
func (*BadRequestError) StatusCode ¶ added in v0.2.0
func (e *BadRequestError) StatusCode() int
type InternalServerError ¶ added in v0.2.0
type InternalServerError struct {
Wrapped error
}
func (*InternalServerError) Error ¶ added in v0.2.0
func (e *InternalServerError) Error() string
func (*InternalServerError) StatusCode ¶ added in v0.2.0
func (e *InternalServerError) StatusCode() int
type InvalidOptionError ¶
type InvalidOptionError struct {
Option string
}
InvalidOptionError is returned when an invalid option is passed in
func (*InvalidOptionError) Error ¶
func (e *InvalidOptionError) Error() string
type NotFoundError ¶ added in v0.2.0
type NotFoundError struct {
// contains filtered or unexported fields
}
func (*NotFoundError) Error ¶ added in v0.2.0
func (e *NotFoundError) Error() string
func (*NotFoundError) StatusCode ¶ added in v0.2.0
func (e *NotFoundError) StatusCode() int
type NotImplementedError ¶ added in v0.2.0
type NotImplementedError struct { }
func (*NotImplementedError) Error ¶ added in v0.2.0
func (e *NotImplementedError) Error() string
func (*NotImplementedError) StatusCode ¶ added in v0.2.0
func (e *NotImplementedError) StatusCode() int
type Response ¶
type Response struct { Status *Status `json:"status,omitempty" xml:"status,omitempty"` Tracing *Tracing `json:"tx,omitempty" xml:"tx,omitempty"` Item interface{} `json:"item,omitempty" xml:"item,omitempty"` Items interface{} `json:"items,omitempty" xml:"items,omitempty"` Data interface{} `json:"data,omitempty" xml:"data,omitempty"` }
func ErrorResponse ¶ added in v0.2.0
func ItemResponse ¶ added in v0.2.0
func ItemResponse(item interface{}) Response
func ItemsResponse ¶ added in v0.2.0
func ItemsResponse(item interface{}) Response
func SimpleResponse ¶ added in v0.2.0
type Tenant ¶ added in v0.2.0
type Tenant struct {
// contains filtered or unexported fields
}
func NewTenantId ¶ added in v0.2.0
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package classification EARS Documentation EARS API Schemes: http https BasePath: / Version: 1.0.0 Host: ears.comcast.com Consumes: - application/json Produces: - application/json Security: - basic SecurityDefinitions: basic: type: basic swagger:meta
|
Package classification EARS Documentation EARS API Schemes: http https BasePath: / Version: 1.0.0 Host: ears.comcast.com Consumes: - application/json Produces: - application/json Security: - basic SecurityDefinitions: basic: type: basic swagger:meta |
Click to show internal directories.
Click to hide internal directories.