Documentation ¶
Index ¶
- func DecodeEvaluateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func DecodeLockRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func DecodeUnlockRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func EncodeEvaluateResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
- func EncodeLockResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
- func EncodeUnlockResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
- func EvaluatePolicyPath(group string, policyName string, version string) string
- func EvaluatePolicyPath2(group string, policyName string, version string) string
- func EvaluatePolicyPath3(group string, policyName string, version string) string
- func LockPolicyPath(group string, policyName string, version string) string
- func Mount(mux goahttp.Muxer, h *Server)
- func MountEvaluateHandler(mux goahttp.Muxer, h http.Handler)
- func MountLockHandler(mux goahttp.Muxer, h http.Handler)
- func MountUnlockHandler(mux goahttp.Muxer, h http.Handler)
- func NewEvaluateHandler(endpoint goa.Endpoint, mux goahttp.Muxer, ...) http.Handler
- func NewEvaluateRequest(body interface{}, group string, policyName string, version string, ...) *policy.EvaluateRequest
- func NewLockHandler(endpoint goa.Endpoint, mux goahttp.Muxer, ...) http.Handler
- func NewLockRequest(group string, policyName string, version string) *policy.LockRequest
- func NewUnlockHandler(endpoint goa.Endpoint, mux goahttp.Muxer, ...) http.Handler
- func NewUnlockRequest(group string, policyName string, version string) *policy.UnlockRequest
- func UnlockPolicyPath(group string, policyName string, version string) string
- type ErrorNamer
- type MountPoint
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeEvaluateRequest ¶
func DecodeEvaluateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeEvaluateRequest returns a decoder for requests sent to the policy Evaluate endpoint.
func DecodeLockRequest ¶
func DecodeLockRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeLockRequest returns a decoder for requests sent to the policy Lock endpoint.
func DecodeUnlockRequest ¶
func DecodeUnlockRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeUnlockRequest returns a decoder for requests sent to the policy Unlock endpoint.
func EncodeEvaluateResponse ¶
func EncodeEvaluateResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
EncodeEvaluateResponse returns an encoder for responses returned by the policy Evaluate endpoint.
func EncodeLockResponse ¶
func EncodeLockResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
EncodeLockResponse returns an encoder for responses returned by the policy Lock endpoint.
func EncodeUnlockResponse ¶
func EncodeUnlockResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
EncodeUnlockResponse returns an encoder for responses returned by the policy Unlock endpoint.
func EvaluatePolicyPath ¶
EvaluatePolicyPath returns the URL path to the policy service Evaluate HTTP endpoint.
func EvaluatePolicyPath2 ¶
EvaluatePolicyPath2 returns the URL path to the policy service Evaluate HTTP endpoint.
func EvaluatePolicyPath3 ¶
EvaluatePolicyPath3 returns the URL path to the policy service Evaluate HTTP endpoint.
func LockPolicyPath ¶
LockPolicyPath returns the URL path to the policy service Lock HTTP endpoint.
func MountEvaluateHandler ¶
MountEvaluateHandler configures the mux to serve the "policy" service "Evaluate" endpoint.
func MountLockHandler ¶
MountLockHandler configures the mux to serve the "policy" service "Lock" endpoint.
func MountUnlockHandler ¶
MountUnlockHandler configures the mux to serve the "policy" service "Unlock" endpoint.
func NewEvaluateHandler ¶
func NewEvaluateHandler( endpoint goa.Endpoint, mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder, encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, errhandler func(context.Context, http.ResponseWriter, error), formatter func(err error) goahttp.Statuser, ) http.Handler
NewEvaluateHandler creates a HTTP handler which loads the HTTP request and calls the "policy" service "Evaluate" endpoint.
func NewEvaluateRequest ¶
func NewEvaluateRequest(body interface{}, group string, policyName string, version string, evaluationID *string, ttl *int) *policy.EvaluateRequest
NewEvaluateRequest builds a policy service Evaluate endpoint payload.
func NewLockHandler ¶
func NewLockHandler( endpoint goa.Endpoint, mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder, encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, errhandler func(context.Context, http.ResponseWriter, error), formatter func(err error) goahttp.Statuser, ) http.Handler
NewLockHandler creates a HTTP handler which loads the HTTP request and calls the "policy" service "Lock" endpoint.
func NewLockRequest ¶
func NewLockRequest(group string, policyName string, version string) *policy.LockRequest
NewLockRequest builds a policy service Lock endpoint payload.
func NewUnlockHandler ¶
func NewUnlockHandler( endpoint goa.Endpoint, mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder, encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, errhandler func(context.Context, http.ResponseWriter, error), formatter func(err error) goahttp.Statuser, ) http.Handler
NewUnlockHandler creates a HTTP handler which loads the HTTP request and calls the "policy" service "Unlock" endpoint.
func NewUnlockRequest ¶
func NewUnlockRequest(group string, policyName string, version string) *policy.UnlockRequest
NewUnlockRequest builds a policy service Unlock endpoint payload.
Types ¶
type ErrorNamer ¶
type ErrorNamer interface {
ErrorName() string
}
ErrorNamer is an interface implemented by generated error structs that exposes the name of the error as defined in the design.
type MountPoint ¶
type MountPoint struct { // Method is the name of the service method served by the mounted HTTP handler. Method string // Verb is the HTTP method used to match requests to the mounted handler. Verb string // Pattern is the HTTP request path pattern used to match requests to the // mounted handler. Pattern string }
MountPoint holds information about the mounted endpoints.
type Server ¶
type Server struct { Mounts []*MountPoint Evaluate http.Handler Lock http.Handler Unlock http.Handler }
Server lists the policy service endpoint HTTP handlers.
func New ¶
func New( e *policy.Endpoints, mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder, encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, errhandler func(context.Context, http.ResponseWriter, error), formatter func(err error) goahttp.Statuser, ) *Server
New instantiates HTTP handlers for all the policy service endpoints using the provided encoder and decoder. The handlers are mounted on the given mux using the HTTP verb and path defined in the design. errhandler is called whenever a response fails to be encoded. formatter is used to format errors returned by the service methods prior to encoding. Both errhandler and formatter are optional and can be nil.