Documentation
¶
Overview ¶
Package server provides primitives to interact with the openapi HTTP API.
Code generated by github.com/discord-gophers/goapi-gen version (devel) DO NOT EDIT.
Index ¶
- func Handler(si ServerInterface, opts ...ServerOption) http.Handler
- type Argument
- type CreateResource2JSONBody
- type CreateResource2JSONRequestBody
- type CreateResource2Params
- type CreateResourceJSONBody
- type CreateResourceJSONRequestBody
- type EveryTypeOptional
- type EveryTypeRequired
- type GetWithArgsParams
- type GetWithContentTypeParamsContentType
- type InvalidParamFormatError
- type Middlewares
- type ParameterError
- type RequiredHeaderError
- type RequiredParamError
- type ReservedKeyword
- type Resource
- type Response
- func CreateResource2JSON200Response(body struct{ ... }) *Response
- func CreateResourceJSON200Response(body struct{ ... }) *Response
- func GetEveryTypeOptionalJSON200Response(body EveryTypeOptional) *Response
- func GetReservedKeywordJSON200Response(body ReservedKeyword) *Response
- func GetResponseWithReferenceJSON200Response(body SomeObject) *Response
- func GetSimpleJSON200Response(body SomeObject) *Response
- func GetWithArgsJSON200Response(body struct{ ... }) *Response
- func GetWithContentTypeJSON200Response(body SomeObject) *Response
- func GetWithReferencesJSON200Response(body struct{ ... }) *Response
- func GetWithTaggedMiddlewareJSON200Response(body struct{ ... }) *Response
- func PostWithTaggedMiddlewareJSON200Response(body struct{ ... }) *Response
- func UpdateResource3JSON200Response(body struct{ ... }) *Response
- func (resp *Response) ContentType(contentType string) *Response
- func (resp *Response) MarshalJSON() ([]byte, error)
- func (resp *Response) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- func (resp *Response) Render(w http.ResponseWriter, r *http.Request) error
- func (resp *Response) Status(code int) *Response
- type ResponseWithReference
- type ServerInterface
- type ServerInterfaceMock
- func (mock *ServerInterfaceMock) CreateResource(w http.ResponseWriter, r *http.Request, argument Argument) *Response
- func (mock *ServerInterfaceMock) CreateResource2(w http.ResponseWriter, r *http.Request, inlineArgument int, ...) *Response
- func (mock *ServerInterfaceMock) CreateResource2Calls() []struct{ ... }
- func (mock *ServerInterfaceMock) CreateResourceCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) GetEveryTypeOptional(w http.ResponseWriter, r *http.Request) *Response
- func (mock *ServerInterfaceMock) GetEveryTypeOptionalCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) GetReservedKeyword(w http.ResponseWriter, r *http.Request) *Response
- func (mock *ServerInterfaceMock) GetReservedKeywordCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) GetResponseWithReference(w http.ResponseWriter, r *http.Request) *Response
- func (mock *ServerInterfaceMock) GetResponseWithReferenceCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) GetSimple(w http.ResponseWriter, r *http.Request) *Response
- func (mock *ServerInterfaceMock) GetSimpleCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) GetWithArgs(w http.ResponseWriter, r *http.Request, params GetWithArgsParams) *Response
- func (mock *ServerInterfaceMock) GetWithArgsCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) GetWithContentType(w http.ResponseWriter, r *http.Request, ...) *Response
- func (mock *ServerInterfaceMock) GetWithContentTypeCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) GetWithReferences(w http.ResponseWriter, r *http.Request, globalArgument int64, ...) *Response
- func (mock *ServerInterfaceMock) GetWithReferencesCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) GetWithTaggedMiddleware(w http.ResponseWriter, r *http.Request) *Response
- func (mock *ServerInterfaceMock) GetWithTaggedMiddlewareCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) PostWithTaggedMiddleware(w http.ResponseWriter, r *http.Request) *Response
- func (mock *ServerInterfaceMock) PostWithTaggedMiddlewareCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) UpdateResource3(w http.ResponseWriter, r *http.Request, pFallthrough int) *Response
- func (mock *ServerInterfaceMock) UpdateResource3Calls() []struct{ ... }
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) CreateResource(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CreateResource2(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetEveryTypeOptional(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetReservedKeyword(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetResponseWithReference(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetSimple(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetWithArgs(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetWithContentType(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetWithReferences(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetWithTaggedMiddleware(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostWithTaggedMiddleware(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) UpdateResource3(w http.ResponseWriter, r *http.Request)
- type ServerOption
- func WithErrorHandler(handler func(w http.ResponseWriter, r *http.Request, err error)) ServerOption
- func WithMiddlewares(middlewares Middlewares) ServerOption
- func WithOperationMiddleware(middleware func(http.Handler) http.Handler) ServerOption
- func WithPathMiddleware(middleware func(http.Handler) http.Handler) ServerOption
- func WithRouter(r chi.Router) ServerOption
- func WithServerBaseURL(url string) ServerOption
- type ServerOptions
- type SimpleResponse
- type SomeObject
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshalingParamError
- type UpdateResource3JSONBody
- type UpdateResource3JSONRequestBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler(si ServerInterface, opts ...ServerOption) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
Types ¶
type CreateResource2JSONBody ¶
type CreateResource2JSONBody Resource
CreateResource2JSONBody defines parameters for CreateResource2.
type CreateResource2JSONRequestBody ¶
type CreateResource2JSONRequestBody CreateResource2JSONBody
CreateResource2JSONRequestBody defines body for CreateResource2 for application/json ContentType.
type CreateResource2Params ¶
type CreateResource2Params struct {
// Some query argument
InlineQueryArgument *int `json:"inline_query_argument,omitempty"`
}
CreateResource2Params defines parameters for CreateResource2.
type CreateResourceJSONBody ¶
type CreateResourceJSONBody EveryTypeRequired
CreateResourceJSONBody defines parameters for CreateResource.
type CreateResourceJSONRequestBody ¶
type CreateResourceJSONRequestBody CreateResourceJSONBody
CreateResourceJSONRequestBody defines body for CreateResource for application/json ContentType.
type EveryTypeOptional ¶
type EveryTypeOptional struct {
ArrayInlineField []int `json:"array_inline_field,omitempty"`
ArrayReferencedField []SomeObject `json:"array_referenced_field,omitempty"`
BoolField *bool `json:"bool_field,omitempty"`
ByteField []byte `json:"byte_field,omitempty"`
DateField *openapi_types.Date `json:"date_field,omitempty"`
DateTimeField *time.Time `json:"date_time_field,omitempty"`
DoubleField *float64 `json:"double_field,omitempty"`
FloatField *float32 `json:"float_field,omitempty"`
InlineObjectField *struct {
Name string `json:"name"`
Number int `json:"number"`
} `json:"inline_object_field,omitempty"`
Int32Field *int32 `json:"int32_field,omitempty"`
Int64Field *int64 `json:"int64_field,omitempty"`
IntField *int `json:"int_field,omitempty"`
NumberField *float32 `json:"number_field,omitempty"`
ReferencedField *SomeObject `json:"referenced_field,omitempty"`
StringField *string `json:"string_field,omitempty"`
}
EveryTypeOptional defines model for EveryTypeOptional.
type EveryTypeRequired ¶
type EveryTypeRequired struct {
ArrayInlineField []int `json:"array_inline_field"`
ArrayReferencedField []SomeObject `json:"array_referenced_field"`
BoolField bool `json:"bool_field"`
ByteField []byte `json:"byte_field"`
DateField openapi_types.Date `json:"date_field"`
DateTimeField time.Time `json:"date_time_field"`
DoubleField float64 `json:"double_field"`
EmailField *openapi_types.Email `json:"email_field,omitempty"`
FloatField float32 `json:"float_field"`
InlineObjectField struct {
Name string `json:"name"`
Number int `json:"number"`
} `json:"inline_object_field"`
Int32Field int32 `json:"int32_field"`
Int64Field int64 `json:"int64_field"`
IntField int `json:"int_field"`
NumberField float32 `json:"number_field"`
ReferencedField SomeObject `json:"referenced_field"`
StringField string `json:"string_field"`
}
EveryTypeRequired defines model for EveryTypeRequired.
type GetWithArgsParams ¶
type GetWithArgsParams struct {
// An optional query argument
OptionalArgument *int64 `json:"optional_argument,omitempty"`
// A required query argument
RequiredArgument int64 `json:"required_argument"`
// An optional query argument
HeaderArgument *int32 `json:"header_argument,omitempty"`
}
GetWithArgsParams defines parameters for GetWithArgs.
type GetWithContentTypeParamsContentType ¶
type GetWithContentTypeParamsContentType string
GetWithContentTypeParamsContentType defines parameters for GetWithContentType.
type InvalidParamFormatError ¶
type InvalidParamFormatError struct {
// contains filtered or unexported fields
}
func (InvalidParamFormatError) Error ¶ added in v0.2.0
func (err InvalidParamFormatError) Error() string
Error implements error.
func (InvalidParamFormatError) ParamName ¶ added in v0.2.0
func (err InvalidParamFormatError) ParamName() string
func (InvalidParamFormatError) Unwrap ¶ added in v0.2.0
func (err InvalidParamFormatError) Unwrap() error
type Middlewares ¶ added in v0.3.0
type Middlewares struct {
Operation func(http.Handler) http.Handler
Path func(http.Handler) http.Handler
}
Middlewares holds the set of middleware for this service
type ParameterError ¶ added in v0.2.0
type ParameterError interface {
error
// ParamName is the name of the parameter that the error is referring to.
ParamName() string
}
ParameterName is an interface that is implemented by error types that are relevant to a specific parameter.
type RequiredHeaderError ¶
type RequiredHeaderError struct {
// contains filtered or unexported fields
}
func (RequiredHeaderError) Error ¶ added in v0.2.0
func (err RequiredHeaderError) Error() string
Error implements error.
func (RequiredHeaderError) ParamName ¶ added in v0.2.0
func (err RequiredHeaderError) ParamName() string
type RequiredParamError ¶
type RequiredParamError struct {
// contains filtered or unexported fields
}
func (RequiredParamError) Error ¶ added in v0.2.0
func (err RequiredParamError) Error() string
Error implements error.
func (RequiredParamError) ParamName ¶ added in v0.2.0
func (err RequiredParamError) ParamName() string
func (RequiredParamError) Unwrap ¶ added in v0.2.0
func (err RequiredParamError) Unwrap() error
type ReservedKeyword ¶
type ReservedKeyword struct {
Channel *string `json:"channel,omitempty"`
}
ReservedKeyword defines model for ReservedKeyword.
type Response ¶
type Response struct {
Code int
// contains filtered or unexported fields
}
Response is a common response struct for all the API calls. A Response object may be instantiated via functions for specific operation responses. It may also be instantiated directly, for the purpose of responding with a single status code.
func CreateResource2JSON200Response ¶
CreateResource2JSON200Response is a constructor method for a CreateResource2 response. A *Response is returned with the configured status code and content type from the spec.
func CreateResourceJSON200Response ¶
CreateResourceJSON200Response is a constructor method for a CreateResource response. A *Response is returned with the configured status code and content type from the spec.
func GetEveryTypeOptionalJSON200Response ¶
func GetEveryTypeOptionalJSON200Response(body EveryTypeOptional) *Response
GetEveryTypeOptionalJSON200Response is a constructor method for a GetEveryTypeOptional response. A *Response is returned with the configured status code and content type from the spec.
func GetReservedKeywordJSON200Response ¶
func GetReservedKeywordJSON200Response(body ReservedKeyword) *Response
GetReservedKeywordJSON200Response is a constructor method for a GetReservedKeyword response. A *Response is returned with the configured status code and content type from the spec.
func GetResponseWithReferenceJSON200Response ¶
func GetResponseWithReferenceJSON200Response(body SomeObject) *Response
GetResponseWithReferenceJSON200Response is a constructor method for a GetResponseWithReference response. A *Response is returned with the configured status code and content type from the spec.
func GetSimpleJSON200Response ¶
func GetSimpleJSON200Response(body SomeObject) *Response
GetSimpleJSON200Response is a constructor method for a GetSimple response. A *Response is returned with the configured status code and content type from the spec.
func GetWithArgsJSON200Response ¶
GetWithArgsJSON200Response is a constructor method for a GetWithArgs response. A *Response is returned with the configured status code and content type from the spec.
func GetWithContentTypeJSON200Response ¶
func GetWithContentTypeJSON200Response(body SomeObject) *Response
GetWithContentTypeJSON200Response is a constructor method for a GetWithContentType response. A *Response is returned with the configured status code and content type from the spec.
func GetWithReferencesJSON200Response ¶
GetWithReferencesJSON200Response is a constructor method for a GetWithReferences response. A *Response is returned with the configured status code and content type from the spec.
func GetWithTaggedMiddlewareJSON200Response ¶
GetWithTaggedMiddlewareJSON200Response is a constructor method for a GetWithTaggedMiddleware response. A *Response is returned with the configured status code and content type from the spec.
func PostWithTaggedMiddlewareJSON200Response ¶
PostWithTaggedMiddlewareJSON200Response is a constructor method for a PostWithTaggedMiddleware response. A *Response is returned with the configured status code and content type from the spec.
func UpdateResource3JSON200Response ¶
UpdateResource3JSON200Response is a constructor method for a UpdateResource3 response. A *Response is returned with the configured status code and content type from the spec.
func (*Response) ContentType ¶
ContentType is a builder method to override the default content type for a response.
func (*Response) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. This is used to only marshal the body of the response.
func (*Response) MarshalXML ¶
MarshalXML implements the xml.Marshaler interface. This is used to only marshal the body of the response.
type ResponseWithReference ¶
type ResponseWithReference SomeObject
ResponseWithReference defines model for ResponseWithReference.
type ServerInterface ¶
type ServerInterface interface {
// get every type optional
// (GET /every-type-optional)
GetEveryTypeOptional(w http.ResponseWriter, r *http.Request) *Response
// Get resource via simple path
// (GET /get-simple)
GetSimple(w http.ResponseWriter, r *http.Request) *Response
// Getter with referenced parameter and referenced response
// (GET /get-with-args)
GetWithArgs(w http.ResponseWriter, r *http.Request, params GetWithArgsParams) *Response
// Getter with referenced parameter and referenced response
// (GET /get-with-references/{global_argument}/{argument})
GetWithReferences(w http.ResponseWriter, r *http.Request, globalArgument int64, argument Argument) *Response
// Get an object by ID
// (GET /get-with-type/{content_type})
GetWithContentType(w http.ResponseWriter, r *http.Request, contentType GetWithContentTypeParamsContentType) *Response
// get with reserved keyword
// (GET /reserved-keyword)
GetReservedKeyword(w http.ResponseWriter, r *http.Request) *Response
// Create a resource
// (POST /resource/{argument})
CreateResource(w http.ResponseWriter, r *http.Request, argument Argument) *Response
// Create a resource with inline parameter
// (POST /resource2/{inline_argument})
CreateResource2(w http.ResponseWriter, r *http.Request, inlineArgument int, params CreateResource2Params) *Response
// Update a resource with inline body. The parameter name is a reserved
// keyword, so make sure that gets prefixed to avoid syntax errors
// (PUT /resource3/{fallthrough})
UpdateResource3(w http.ResponseWriter, r *http.Request, pFallthrough int) *Response
// get response with reference
// (GET /response-with-reference)
GetResponseWithReference(w http.ResponseWriter, r *http.Request) *Response
// (GET /with-tagged-middleware)
GetWithTaggedMiddleware(w http.ResponseWriter, r *http.Request) *Response
// (POST /with-tagged-middleware)
PostWithTaggedMiddleware(w http.ResponseWriter, r *http.Request) *Response
}
ServerInterface represents all server handlers.
type ServerInterfaceMock ¶
type ServerInterfaceMock struct {
// CreateResourceFunc mocks the CreateResource method.
CreateResourceFunc func(w http.ResponseWriter, r *http.Request, argument Argument) *Response
// CreateResource2Func mocks the CreateResource2 method.
CreateResource2Func func(w http.ResponseWriter, r *http.Request, inlineArgument int, params CreateResource2Params) *Response
// GetEveryTypeOptionalFunc mocks the GetEveryTypeOptional method.
GetEveryTypeOptionalFunc func(w http.ResponseWriter, r *http.Request) *Response
// GetReservedKeywordFunc mocks the GetReservedKeyword method.
GetReservedKeywordFunc func(w http.ResponseWriter, r *http.Request) *Response
// GetResponseWithReferenceFunc mocks the GetResponseWithReference method.
GetResponseWithReferenceFunc func(w http.ResponseWriter, r *http.Request) *Response
// GetSimpleFunc mocks the GetSimple method.
GetSimpleFunc func(w http.ResponseWriter, r *http.Request) *Response
// GetWithArgsFunc mocks the GetWithArgs method.
GetWithArgsFunc func(w http.ResponseWriter, r *http.Request, params GetWithArgsParams) *Response
// GetWithContentTypeFunc mocks the GetWithContentType method.
GetWithContentTypeFunc func(w http.ResponseWriter, r *http.Request, contentType GetWithContentTypeParamsContentType) *Response
// GetWithReferencesFunc mocks the GetWithReferences method.
GetWithReferencesFunc func(w http.ResponseWriter, r *http.Request, globalArgument int64, argument Argument) *Response
// GetWithTaggedMiddlewareFunc mocks the GetWithTaggedMiddleware method.
GetWithTaggedMiddlewareFunc func(w http.ResponseWriter, r *http.Request) *Response
// PostWithTaggedMiddlewareFunc mocks the PostWithTaggedMiddleware method.
PostWithTaggedMiddlewareFunc func(w http.ResponseWriter, r *http.Request) *Response
// UpdateResource3Func mocks the UpdateResource3 method.
UpdateResource3Func func(w http.ResponseWriter, r *http.Request, pFallthrough int) *Response
// contains filtered or unexported fields
}
ServerInterfaceMock is a mock implementation of ServerInterface.
func TestSomethingThatUsesServerInterface(t *testing.T) {
// make and configure a mocked ServerInterface
mockedServerInterface := &ServerInterfaceMock{
CreateResourceFunc: func(w http.ResponseWriter, r *http.Request, argument Argument) *Response {
panic("mock out the CreateResource method")
},
CreateResource2Func: func(w http.ResponseWriter, r *http.Request, inlineArgument int, params CreateResource2Params) *Response {
panic("mock out the CreateResource2 method")
},
GetEveryTypeOptionalFunc: func(w http.ResponseWriter, r *http.Request) *Response {
panic("mock out the GetEveryTypeOptional method")
},
GetReservedKeywordFunc: func(w http.ResponseWriter, r *http.Request) *Response {
panic("mock out the GetReservedKeyword method")
},
GetResponseWithReferenceFunc: func(w http.ResponseWriter, r *http.Request) *Response {
panic("mock out the GetResponseWithReference method")
},
GetSimpleFunc: func(w http.ResponseWriter, r *http.Request) *Response {
panic("mock out the GetSimple method")
},
GetWithArgsFunc: func(w http.ResponseWriter, r *http.Request, params GetWithArgsParams) *Response {
panic("mock out the GetWithArgs method")
},
GetWithContentTypeFunc: func(w http.ResponseWriter, r *http.Request, contentType GetWithContentTypeParamsContentType) *Response {
panic("mock out the GetWithContentType method")
},
GetWithReferencesFunc: func(w http.ResponseWriter, r *http.Request, globalArgument int64, argument Argument) *Response {
panic("mock out the GetWithReferences method")
},
GetWithTaggedMiddlewareFunc: func(w http.ResponseWriter, r *http.Request) *Response {
panic("mock out the GetWithTaggedMiddleware method")
},
PostWithTaggedMiddlewareFunc: func(w http.ResponseWriter, r *http.Request) *Response {
panic("mock out the PostWithTaggedMiddleware method")
},
UpdateResource3Func: func(w http.ResponseWriter, r *http.Request, pFallthrough int) *Response {
panic("mock out the UpdateResource3 method")
},
}
// use mockedServerInterface in code that requires ServerInterface
// and then make assertions.
}
func (*ServerInterfaceMock) CreateResource ¶
func (mock *ServerInterfaceMock) CreateResource(w http.ResponseWriter, r *http.Request, argument Argument) *Response
CreateResource calls CreateResourceFunc.
func (*ServerInterfaceMock) CreateResource2 ¶
func (mock *ServerInterfaceMock) CreateResource2(w http.ResponseWriter, r *http.Request, inlineArgument int, params CreateResource2Params) *Response
CreateResource2 calls CreateResource2Func.
func (*ServerInterfaceMock) CreateResource2Calls ¶
func (mock *ServerInterfaceMock) CreateResource2Calls() []struct { W http.ResponseWriter R *http.Request InlineArgument int Params CreateResource2Params }
CreateResource2Calls gets all the calls that were made to CreateResource2. Check the length with:
len(mockedServerInterface.CreateResource2Calls())
func (*ServerInterfaceMock) CreateResourceCalls ¶
func (mock *ServerInterfaceMock) CreateResourceCalls() []struct { W http.ResponseWriter R *http.Request Argument Argument }
CreateResourceCalls gets all the calls that were made to CreateResource. Check the length with:
len(mockedServerInterface.CreateResourceCalls())
func (*ServerInterfaceMock) GetEveryTypeOptional ¶
func (mock *ServerInterfaceMock) GetEveryTypeOptional(w http.ResponseWriter, r *http.Request) *Response
GetEveryTypeOptional calls GetEveryTypeOptionalFunc.
func (*ServerInterfaceMock) GetEveryTypeOptionalCalls ¶
func (mock *ServerInterfaceMock) GetEveryTypeOptionalCalls() []struct { W http.ResponseWriter R *http.Request }
GetEveryTypeOptionalCalls gets all the calls that were made to GetEveryTypeOptional. Check the length with:
len(mockedServerInterface.GetEveryTypeOptionalCalls())
func (*ServerInterfaceMock) GetReservedKeyword ¶
func (mock *ServerInterfaceMock) GetReservedKeyword(w http.ResponseWriter, r *http.Request) *Response
GetReservedKeyword calls GetReservedKeywordFunc.
func (*ServerInterfaceMock) GetReservedKeywordCalls ¶
func (mock *ServerInterfaceMock) GetReservedKeywordCalls() []struct { W http.ResponseWriter R *http.Request }
GetReservedKeywordCalls gets all the calls that were made to GetReservedKeyword. Check the length with:
len(mockedServerInterface.GetReservedKeywordCalls())
func (*ServerInterfaceMock) GetResponseWithReference ¶
func (mock *ServerInterfaceMock) GetResponseWithReference(w http.ResponseWriter, r *http.Request) *Response
GetResponseWithReference calls GetResponseWithReferenceFunc.
func (*ServerInterfaceMock) GetResponseWithReferenceCalls ¶
func (mock *ServerInterfaceMock) GetResponseWithReferenceCalls() []struct { W http.ResponseWriter R *http.Request }
GetResponseWithReferenceCalls gets all the calls that were made to GetResponseWithReference. Check the length with:
len(mockedServerInterface.GetResponseWithReferenceCalls())
func (*ServerInterfaceMock) GetSimple ¶
func (mock *ServerInterfaceMock) GetSimple(w http.ResponseWriter, r *http.Request) *Response
GetSimple calls GetSimpleFunc.
func (*ServerInterfaceMock) GetSimpleCalls ¶
func (mock *ServerInterfaceMock) GetSimpleCalls() []struct { W http.ResponseWriter R *http.Request }
GetSimpleCalls gets all the calls that were made to GetSimple. Check the length with:
len(mockedServerInterface.GetSimpleCalls())
func (*ServerInterfaceMock) GetWithArgs ¶
func (mock *ServerInterfaceMock) GetWithArgs(w http.ResponseWriter, r *http.Request, params GetWithArgsParams) *Response
GetWithArgs calls GetWithArgsFunc.
func (*ServerInterfaceMock) GetWithArgsCalls ¶
func (mock *ServerInterfaceMock) GetWithArgsCalls() []struct { W http.ResponseWriter R *http.Request Params GetWithArgsParams }
GetWithArgsCalls gets all the calls that were made to GetWithArgs. Check the length with:
len(mockedServerInterface.GetWithArgsCalls())
func (*ServerInterfaceMock) GetWithContentType ¶
func (mock *ServerInterfaceMock) GetWithContentType(w http.ResponseWriter, r *http.Request, contentType GetWithContentTypeParamsContentType) *Response
GetWithContentType calls GetWithContentTypeFunc.
func (*ServerInterfaceMock) GetWithContentTypeCalls ¶
func (mock *ServerInterfaceMock) GetWithContentTypeCalls() []struct { W http.ResponseWriter R *http.Request ContentType GetWithContentTypeParamsContentType }
GetWithContentTypeCalls gets all the calls that were made to GetWithContentType. Check the length with:
len(mockedServerInterface.GetWithContentTypeCalls())
func (*ServerInterfaceMock) GetWithReferences ¶
func (mock *ServerInterfaceMock) GetWithReferences(w http.ResponseWriter, r *http.Request, globalArgument int64, argument Argument) *Response
GetWithReferences calls GetWithReferencesFunc.
func (*ServerInterfaceMock) GetWithReferencesCalls ¶
func (mock *ServerInterfaceMock) GetWithReferencesCalls() []struct { W http.ResponseWriter R *http.Request GlobalArgument int64 Argument Argument }
GetWithReferencesCalls gets all the calls that were made to GetWithReferences. Check the length with:
len(mockedServerInterface.GetWithReferencesCalls())
func (*ServerInterfaceMock) GetWithTaggedMiddleware ¶
func (mock *ServerInterfaceMock) GetWithTaggedMiddleware(w http.ResponseWriter, r *http.Request) *Response
GetWithTaggedMiddleware calls GetWithTaggedMiddlewareFunc.
func (*ServerInterfaceMock) GetWithTaggedMiddlewareCalls ¶
func (mock *ServerInterfaceMock) GetWithTaggedMiddlewareCalls() []struct { W http.ResponseWriter R *http.Request }
GetWithTaggedMiddlewareCalls gets all the calls that were made to GetWithTaggedMiddleware. Check the length with:
len(mockedServerInterface.GetWithTaggedMiddlewareCalls())
func (*ServerInterfaceMock) PostWithTaggedMiddleware ¶
func (mock *ServerInterfaceMock) PostWithTaggedMiddleware(w http.ResponseWriter, r *http.Request) *Response
PostWithTaggedMiddleware calls PostWithTaggedMiddlewareFunc.
func (*ServerInterfaceMock) PostWithTaggedMiddlewareCalls ¶
func (mock *ServerInterfaceMock) PostWithTaggedMiddlewareCalls() []struct { W http.ResponseWriter R *http.Request }
PostWithTaggedMiddlewareCalls gets all the calls that were made to PostWithTaggedMiddleware. Check the length with:
len(mockedServerInterface.PostWithTaggedMiddlewareCalls())
func (*ServerInterfaceMock) UpdateResource3 ¶
func (mock *ServerInterfaceMock) UpdateResource3(w http.ResponseWriter, r *http.Request, pFallthrough int) *Response
UpdateResource3 calls UpdateResource3Func.
func (*ServerInterfaceMock) UpdateResource3Calls ¶
func (mock *ServerInterfaceMock) UpdateResource3Calls() []struct { W http.ResponseWriter R *http.Request PFallthrough int }
UpdateResource3Calls gets all the calls that were made to UpdateResource3. Check the length with:
len(mockedServerInterface.UpdateResource3Calls())
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
Middlewares Middlewares
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) CreateResource ¶
func (siw *ServerInterfaceWrapper) CreateResource(w http.ResponseWriter, r *http.Request)
CreateResource operation middleware
func (*ServerInterfaceWrapper) CreateResource2 ¶
func (siw *ServerInterfaceWrapper) CreateResource2(w http.ResponseWriter, r *http.Request)
CreateResource2 operation middleware
func (*ServerInterfaceWrapper) GetEveryTypeOptional ¶
func (siw *ServerInterfaceWrapper) GetEveryTypeOptional(w http.ResponseWriter, r *http.Request)
GetEveryTypeOptional operation middleware
func (*ServerInterfaceWrapper) GetReservedKeyword ¶
func (siw *ServerInterfaceWrapper) GetReservedKeyword(w http.ResponseWriter, r *http.Request)
GetReservedKeyword operation middleware
func (*ServerInterfaceWrapper) GetResponseWithReference ¶
func (siw *ServerInterfaceWrapper) GetResponseWithReference(w http.ResponseWriter, r *http.Request)
GetResponseWithReference operation middleware
func (*ServerInterfaceWrapper) GetSimple ¶
func (siw *ServerInterfaceWrapper) GetSimple(w http.ResponseWriter, r *http.Request)
GetSimple operation middleware
func (*ServerInterfaceWrapper) GetWithArgs ¶
func (siw *ServerInterfaceWrapper) GetWithArgs(w http.ResponseWriter, r *http.Request)
GetWithArgs operation middleware
func (*ServerInterfaceWrapper) GetWithContentType ¶
func (siw *ServerInterfaceWrapper) GetWithContentType(w http.ResponseWriter, r *http.Request)
GetWithContentType operation middleware
func (*ServerInterfaceWrapper) GetWithReferences ¶
func (siw *ServerInterfaceWrapper) GetWithReferences(w http.ResponseWriter, r *http.Request)
GetWithReferences operation middleware
func (*ServerInterfaceWrapper) GetWithTaggedMiddleware ¶
func (siw *ServerInterfaceWrapper) GetWithTaggedMiddleware(w http.ResponseWriter, r *http.Request)
GetWithTaggedMiddleware operation middleware
func (*ServerInterfaceWrapper) PostWithTaggedMiddleware ¶
func (siw *ServerInterfaceWrapper) PostWithTaggedMiddleware(w http.ResponseWriter, r *http.Request)
PostWithTaggedMiddleware operation middleware
func (*ServerInterfaceWrapper) UpdateResource3 ¶
func (siw *ServerInterfaceWrapper) UpdateResource3(w http.ResponseWriter, r *http.Request)
UpdateResource3 operation middleware
type ServerOption ¶
type ServerOption func(*ServerOptions)
func WithErrorHandler ¶
func WithErrorHandler(handler func(w http.ResponseWriter, r *http.Request, err error)) ServerOption
func WithMiddlewares ¶
func WithMiddlewares(middlewares Middlewares) ServerOption
func WithOperationMiddleware ¶ added in v0.3.0
func WithOperationMiddleware(middleware func(http.Handler) http.Handler) ServerOption
func WithPathMiddleware ¶ added in v0.3.0
func WithPathMiddleware(middleware func(http.Handler) http.Handler) ServerOption
func WithRouter ¶
func WithRouter(r chi.Router) ServerOption
func WithServerBaseURL ¶
func WithServerBaseURL(url string) ServerOption
type ServerOptions ¶
type ServerOptions struct {
BaseURL string
BaseRouter chi.Router
Middlewares Middlewares
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type SimpleResponse ¶
type SimpleResponse struct {
Name string `json:"name"`
}
SimpleResponse defines model for SimpleResponse.
type SomeObject ¶
type SomeObject struct {
Name string `json:"name"`
}
SomeObject defines model for some_object.
type TooManyValuesForParamError ¶
type TooManyValuesForParamError struct {
NumValues int
// contains filtered or unexported fields
}
func (TooManyValuesForParamError) Error ¶ added in v0.2.0
func (err TooManyValuesForParamError) Error() string
Error implements error.
func (TooManyValuesForParamError) ParamName ¶ added in v0.2.0
func (err TooManyValuesForParamError) ParamName() string
type UnescapedCookieParamError ¶
type UnescapedCookieParamError struct {
// contains filtered or unexported fields
}
func (UnescapedCookieParamError) Error ¶ added in v0.2.0
func (err UnescapedCookieParamError) Error() string
Error implements error.
func (UnescapedCookieParamError) ParamName ¶ added in v0.2.0
func (err UnescapedCookieParamError) ParamName() string
func (UnescapedCookieParamError) Unwrap ¶ added in v0.2.0
func (err UnescapedCookieParamError) Unwrap() error
type UnmarshalingParamError ¶
type UnmarshalingParamError struct {
// contains filtered or unexported fields
}
func (UnmarshalingParamError) Error ¶ added in v0.2.0
func (err UnmarshalingParamError) Error() string
Error implements error.
func (UnmarshalingParamError) ParamName ¶ added in v0.2.0
func (err UnmarshalingParamError) ParamName() string
func (UnmarshalingParamError) Unwrap ¶ added in v0.2.0
func (err UnmarshalingParamError) Unwrap() error
type UpdateResource3JSONBody ¶
type UpdateResource3JSONBody struct {
ID *int `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
}
UpdateResource3JSONBody defines parameters for UpdateResource3.
type UpdateResource3JSONRequestBody ¶
type UpdateResource3JSONRequestBody UpdateResource3JSONBody
UpdateResource3JSONRequestBody defines body for UpdateResource3 for application/json ContentType.