Documentation ¶
Index ¶
- Constants
- func RequestIDLogger(logger log.Logger) echo.MiddlewareFunc
- type EchoRouter
- type FSDebugger
- type HTTPServer
- type HTTPServerConfig
- type Handlers
- func (handlers *Handlers) GetExamplesData(c echo.Context) error
- func (handlers *Handlers) GetSchema(c echo.Context) error
- func (handlers *Handlers) GetSwagger20Spec(c echo.Context) error
- func (*Handlers) Metadata(c echo.Context) error
- func (handlers *Handlers) RenderData(c echo.Context) error
- func (handlers *Handlers) RenderExample(c echo.Context) error
- func (handlers *Handlers) Status(c echo.Context) error
- func (*Handlers) StatusSchema(c echo.Context) error
- type HandlersInterface
- type JSONRef
- type JSONSchema
- type JSONSchemaObject
- type JSONSchemaType
- type Metadata
- type PoolStats
- type Router
- type StaticDirConfig
- type Status
- type SwaggerSpecification
- type SwaggerSpecificationInfo
- type SwaggerSpecificationOperation
- type SwaggerSpecificationParameter
- type SwaggerSpecificationPath
- type SwaggerSpecificationResponse
- type SwaggerSpecificationResponses
Constants ¶
const ( JSONSchemaTypeObject = JSONSchemaType("object") JSONSchemaTypeString = JSONSchemaType("string") JSONSchemaTypeNumber = JSONSchemaType("number") )
JSON object types.
Variables ¶
This section is empty.
Functions ¶
func RequestIDLogger ¶
func RequestIDLogger(logger log.Logger) echo.MiddlewareFunc
RequestIDLogger inject logger to request context and extract or generate request ID.
Types ¶
type EchoRouter ¶
EchoRouter implement router with echo.
func NewEchoRouter ¶
func NewEchoRouter( handlers HandlersInterface, logger log.Logger, tracerProvider trace.TracerProvider, staticDirConfig StaticDirConfig, ) (*EchoRouter, error)
NewEchoRouter constructor.
type FSDebugger ¶
type FSDebugger struct {
// contains filtered or unexported fields
}
FSDebugger log static file system calls.
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
HTTPServer wrapper on http.Server.
func ProvideHTTPServer ¶
func ProvideHTTPServer( ctx context.Context, router Router, config HTTPServerConfig, tracerProvider trace.TracerProvider, propagator propagation.TextMapPropagator, ) (*HTTPServer, func(), error)
ProvideHTTPServer create and start HTTP server.
func (*HTTPServer) Close ¶
func (httpServer *HTTPServer) Close(ctx context.Context)
Close HTTP server.
type HTTPServerConfig ¶
type HTTPServerConfig struct { Addr string StopTimeout time.Duration ReuseAddr bool Static StaticDirConfig }
HTTPServerConfig for NewHTTPServer.
func NewHTTPServerConfig ¶
func NewHTTPServerConfig() HTTPServerConfig
NewHTTPServerConfig return config with default values.
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers render template to PDF.
func NewHandlers ¶
func NewHandlers( pdfRenderService services.PDFRenderService, statsService services.StatsService, specService services.SpecService, ) *Handlers
NewHandlers constructor.
func (*Handlers) GetExamplesData ¶ added in v0.9.0
GetExamplesData return examples data.
func (*Handlers) GetSwagger20Spec ¶
GetSwagger20Spec return Swagger 2.0 specification.
func (*Handlers) RenderData ¶
RenderData handler.
func (*Handlers) RenderExample ¶
RenderExample handler.
type HandlersInterface ¶
type HandlersInterface interface { RenderData(echo.Context) error RenderExample(echo.Context) error GetSwagger20Spec(echo.Context) error GetSchema(echo.Context) error GetExamplesData(echo.Context) error Status(echo.Context) error StatusSchema(echo.Context) error Metadata(echo.Context) error }
HandlersInterface define Handlers interface.
type JSONRef ¶
type JSONRef struct {
Ref string `json:"$ref"`
}
JSONRef define JSON reference object.
func (JSONRef) IsJSONSchema ¶ added in v0.9.0
func (JSONRef) IsJSONSchema()
IsJSONSchema implement JSONSchema interface.
type JSONSchema ¶ added in v0.9.0
type JSONSchema interface {
IsJSONSchema()
}
JSONSchema define JSON schema object subset.
type JSONSchemaObject ¶ added in v0.9.0
type JSONSchemaObject struct { Type JSONSchemaType `json:"type"` Properties map[string]JSONSchema `json:"properties,omitempty"` Items JSONSchema `json:"items,omitempty"` Required []string `json:"required,omitempty"` Additional JSONSchema `json:"additionalProperties,omitempty"` }
JSONSchemaObject define JSON schema object.
func (JSONSchemaObject) IsJSONSchema ¶ added in v0.9.0
func (JSONSchemaObject) IsJSONSchema()
IsJSONSchema implement JSONSchema interface.
type JSONSchemaType ¶ added in v0.9.0
type JSONSchemaType string
JSONSchemaType define JSON object type.
type PoolStats ¶
type PoolStats struct { Active int `json:"active"` Idle int `json:"idle"` Destroyed int `json:"destroyed"` Invalidated int `json:"invalidated"` }
PoolStats of internal render pool.
type StaticDirConfig ¶ added in v0.7.2
StaticDirConfig define path and enabling to static dir.
func DefaultStaticDirConfig ¶ added in v0.7.2
func DefaultStaticDirConfig() StaticDirConfig
DefaultStaticDirConfig provider.
func (*StaticDirConfig) Flags ¶ added in v0.7.2
func (config *StaticDirConfig) Flags() []cliV2.Flag
Flags return config bindings for cli.
type Status ¶
type Status struct { PoolStats PoolStats `json:"pool_stats"` RenderPoolType string `json:"render_pool_type"` Metadata map[string]string `json:"metadata"` }
Status response structure.
type SwaggerSpecification ¶
type SwaggerSpecification struct { Swagger string `json:"swagger"` Info SwaggerSpecificationInfo `json:"info"` Paths map[string]SwaggerSpecificationPath `json:"paths"` }
SwaggerSpecification define swagger 2.0 specification subset.
func BuildSwaggerSpecification ¶
func BuildSwaggerSpecification( templateMetadataList []services.TemplateSpec, ) SwaggerSpecification
BuildSwaggerSpecification v2.0 from internal entities.
type SwaggerSpecificationInfo ¶
type SwaggerSpecificationInfo struct { Title string `json:"title"` Version string `json:"version"` }
SwaggerSpecificationInfo define info object subset of swagger 2.0 specification.
type SwaggerSpecificationOperation ¶
type SwaggerSpecificationOperation struct { Consumes []string `json:"consumes,omitempty"` Produces []string `json:"produces,omitempty"` Tags []string `json:"tags"` Responses SwaggerSpecificationResponses `json:"responses"` Parameters []SwaggerSpecificationParameter `json:"parameters,omitempty"` }
SwaggerSpecificationOperation define operation object subset of swagger 2.0 specification.
type SwaggerSpecificationParameter ¶
type SwaggerSpecificationParameter struct { Name string `json:"name"` In string `json:"in"` Required bool `json:"required"` Schema JSONSchema `json:"schema,omitempty"` }
SwaggerSpecificationParameter define parameter object subset of swagger 2.0 specification.
type SwaggerSpecificationPath ¶
type SwaggerSpecificationPath struct { Get *SwaggerSpecificationOperation `json:"get,omitempty"` Post *SwaggerSpecificationOperation `json:"post,omitempty"` }
SwaggerSpecificationPath define path object subset of swagger 2.0 specification.
type SwaggerSpecificationResponse ¶
type SwaggerSpecificationResponse struct { Description string `json:"description"` Schema JSONSchema `json:"schema,omitempty"` }
SwaggerSpecificationResponse define response object subset of swagger 2.0 specification.
type SwaggerSpecificationResponses ¶
type SwaggerSpecificationResponses map[int]SwaggerSpecificationResponse
SwaggerSpecificationResponses define responses object subset of swagger 2.0 specification.