Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIEndpoint ¶
type APIEndpoint struct { Metadata *types.APIRequestMetadata DecoderValidator RequestDecoderValidator Writer ResultWriter }
type APIEndpointFactory ¶
type APIEndpointFactory interface { NewAPIEndpoint(metadata *types.APIRequestMetadata) *APIEndpoint GetDecoderValidator() RequestDecoderValidator GetResultWriter() ResultWriter }
func NewAPIObjectEndpointFactory ¶
func NewAPIObjectEndpointFactory(conf *config.Config) APIEndpointFactory
type APIObjectEndpointFactory ¶
type APIObjectEndpointFactory struct { DecoderValidator RequestDecoderValidator ResultWriter ResultWriter }
func (*APIObjectEndpointFactory) GetDecoderValidator ¶
func (factory *APIObjectEndpointFactory) GetDecoderValidator() RequestDecoderValidator
func (*APIObjectEndpointFactory) GetResultWriter ¶
func (factory *APIObjectEndpointFactory) GetResultWriter() ResultWriter
func (*APIObjectEndpointFactory) NewAPIEndpoint ¶
func (factory *APIObjectEndpointFactory) NewAPIEndpoint( metadata *types.APIRequestMetadata, ) *APIEndpoint
type DefaultRequestDecoderValidator ¶
type DefaultRequestDecoderValidator struct {
// contains filtered or unexported fields
}
func (*DefaultRequestDecoderValidator) DecodeAndValidate ¶
func (j *DefaultRequestDecoderValidator) DecodeAndValidate( w http.ResponseWriter, r *http.Request, v interface{}, ) (ok bool)
func (*DefaultRequestDecoderValidator) DecodeAndValidateNoWrite ¶
func (j *DefaultRequestDecoderValidator) DecodeAndValidateNoWrite( r *http.Request, v interface{}, ) error
type DefaultResultWriter ¶
type DefaultResultWriter struct {
// contains filtered or unexported fields
}
default generalizes response codes for common operations (http.StatusOK, http.StatusCreated, etc)
func (*DefaultResultWriter) WriteResult ¶
func (j *DefaultResultWriter) WriteResult(w http.ResponseWriter, r *http.Request, v interface{})
type RequestDecoderValidator ¶
type RequestDecoderValidator interface { DecodeAndValidate(w http.ResponseWriter, r *http.Request, v interface{}) bool DecodeAndValidateNoWrite(r *http.Request, v interface{}) error }
func NewDefaultRequestDecoderValidator ¶
func NewDefaultRequestDecoderValidator( conf *config.Config, ) RequestDecoderValidator
type ResultWriter ¶
type ResultWriter interface {
WriteResult(w http.ResponseWriter, r *http.Request, v interface{})
}
func NewDefaultResultWriter ¶
func NewDefaultResultWriter(conf *config.Config) ResultWriter
Click to show internal directories.
Click to hide internal directories.