Documentation ¶
Index ¶
- Variables
- func InstrumentingMiddleware(duration metrics.Histogram) endpoint.Middleware
- func LoggingMiddleware(logger log.Logger) endpoint.Middleware
- func MakeHashEndpoint(s vaultservice.Service) endpoint.Endpoint
- func MakeValidateEndpoint(s vaultservice.Service) endpoint.Endpoint
- type HashRequest
- type HashResponse
- type Set
- type ValidateRequest
- type ValidateResponse
Constants ¶
This section is empty.
Variables ¶
var SigningKey = []byte("zmh298onj30")
SigningKey is a JWT signing key.
Functions ¶
func InstrumentingMiddleware ¶
func InstrumentingMiddleware(duration metrics.Histogram) endpoint.Middleware
InstrumentingMiddleware returns an endpoint middleware that records the duration of each invocation to the passed histogram. The middleware adds a single field: "success", which is "true" if no error is returned, and "false" otherwise.
func LoggingMiddleware ¶
func LoggingMiddleware(logger log.Logger) endpoint.Middleware
LoggingMiddleware returns an endpoint middleware that logs the duration of each invocation, and the resulting error, if any.
func MakeHashEndpoint ¶
func MakeHashEndpoint(s vaultservice.Service) endpoint.Endpoint
MakeHashEndpoint constructs a Hash endpoint wrapping the service.
func MakeValidateEndpoint ¶
func MakeValidateEndpoint(s vaultservice.Service) endpoint.Endpoint
MakeValidateEndpoint constructs a Validate endpoint wrapping the service.
Types ¶
type HashRequest ¶
type HashRequest struct {
Password string `json:"password"`
}
type HashResponse ¶
func (HashResponse) Failed ¶
func (r HashResponse) Failed() error
type Set ¶
Set collects all of the endpoints that compose a vault service.
func New ¶
func New(svc vaultservice.Service, duration metrics.Histogram, otTracer stdopentracing.Tracer, zipkinTracer *stdzipkin.Tracer, logger log.Logger) Set
New returns a Set that wraps the provided server, and wires in all of the expected endpoint middlewares via the various parameters
type ValidateRequest ¶
type ValidateResponse ¶
func (ValidateResponse) Failed ¶
func (r ValidateResponse) Failed() error