Documentation ¶
Index ¶
- Constants
- func IsInvalidConfig(err error) bool
- type Config
- type Endpoint
- func (e *Endpoint) Decoder() kithttp.DecodeRequestFunc
- func (e *Endpoint) Encoder() kithttp.EncodeResponseFunc
- func (e *Endpoint) Endpoint() kitendpoint.Endpoint
- func (e *Endpoint) Method() string
- func (e *Endpoint) Middlewares() []kitendpoint.Middleware
- func (e *Endpoint) Name() string
- func (e *Endpoint) Path() string
- type Response
Constants ¶
View Source
const ( // Method is the HTTP method this endpoint is registered for. Method = "GET" // Name identifies the endpoint. It is aligned to the package path. Name = "version" // Path is the HTTP request path this endpoint is registered for. Path = "/" )
Variables ¶
This section is empty.
Functions ¶
func IsInvalidConfig ¶
IsInvalidConfig asserts invalidConfigError.
Types ¶
type Config ¶
type Config struct { // Dependencies. Logger micrologger.Logger Middleware *middleware.Middleware Service *service.Service }
Config represents the configuration used to create a version endpoint.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig provides a default configuration to create a new version endpoint by best effort.
type Endpoint ¶
type Endpoint struct {
Config
}
func (*Endpoint) Decoder ¶
func (e *Endpoint) Decoder() kithttp.DecodeRequestFunc
func (*Endpoint) Encoder ¶
func (e *Endpoint) Encoder() kithttp.EncodeResponseFunc
func (*Endpoint) Endpoint ¶
func (e *Endpoint) Endpoint() kitendpoint.Endpoint
func (*Endpoint) Middlewares ¶
func (e *Endpoint) Middlewares() []kitendpoint.Middleware
type Response ¶
type Response struct { Description string `json:"description"` GitCommit string `json:"git_commit"` GoVersion string `json:"go_version"` Name string `json:"name"` OSArch string `json:"os_arch"` Source string `json:"source"` }
Response is the return value of the service action.
func DefaultResponse ¶
func DefaultResponse() *Response
DefaultResponse provides a default response object by best effort.
Click to show internal directories.
Click to hide internal directories.