Documentation
¶
Overview ¶
Package server provides primitives to interact with the openapi HTTP API.
Code generated by github.com/KosyanMedia/oapi-codegen/v2 version (devel) DO NOT EDIT.
Index ¶
- func RegisterHandlers(router EchoRouter, si ServerInterface, admin echo.MiddlewareFunc, ...)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string, ...)
- type Argument
- type CreateEveryTypeOptionalJSONBody
- type CreateEveryTypeOptionalJSONRequestBody
- type CreateEveryTypeOptionalParams
- type CreateResource2JSONBody
- type CreateResource2JSONRequestBody
- type CreateResource2Params
- type CreateResource2Response
- type CreateResourceJSONBody
- type CreateResourceJSONRequestBody
- type CreateResourceResponse
- type CustomEnumType
- type EchoRouter
- type EchoRouterMock
- func (mock *EchoRouterMock) CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (mock *EchoRouterMock) CONNECTCalls() []struct{ ... }
- func (mock *EchoRouterMock) DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (mock *EchoRouterMock) DELETECalls() []struct{ ... }
- func (mock *EchoRouterMock) GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (mock *EchoRouterMock) GETCalls() []struct{ ... }
- func (mock *EchoRouterMock) HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (mock *EchoRouterMock) HEADCalls() []struct{ ... }
- func (mock *EchoRouterMock) OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (mock *EchoRouterMock) OPTIONSCalls() []struct{ ... }
- func (mock *EchoRouterMock) PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (mock *EchoRouterMock) PATCHCalls() []struct{ ... }
- func (mock *EchoRouterMock) POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (mock *EchoRouterMock) POSTCalls() []struct{ ... }
- func (mock *EchoRouterMock) PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (mock *EchoRouterMock) PUTCalls() []struct{ ... }
- func (mock *EchoRouterMock) TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (mock *EchoRouterMock) TRACECalls() []struct{ ... }
- type Error
- type EveryTypeOptional
- type EveryTypeRequired
- type GetEveryTypeOptionalResponse
- type GetReservedKeywordResponse
- type GetResponseWithReferenceResponse
- type GetSimpleResponse
- type GetWithArgsParams
- type GetWithArgsResponse
- type GetWithContentTypeParamsContentType
- type GetWithContentTypeResponse
- type GetWithReferencesResponse
- type ReservedKeyword
- type Resource
- type ResponseWithReference
- type ServerInterface
- type ServerInterfaceMock
- func (mock *ServerInterfaceMock) CreateEveryTypeOptional(ctx echo.Context, params CreateEveryTypeOptionalParams, ...) (int, error)
- func (mock *ServerInterfaceMock) CreateEveryTypeOptionalCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) CreateResource(ctx echo.Context, argument string, requestBody EveryTypeRequired) (*CreateResourceResponse, error)
- func (mock *ServerInterfaceMock) CreateResource2(ctx echo.Context, inlineArgument int, params CreateResource2Params, ...) (*CreateResource2Response, error)
- func (mock *ServerInterfaceMock) CreateResource2Calls() []struct{ ... }
- func (mock *ServerInterfaceMock) CreateResourceCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) Error(err error) (int, Error)
- func (mock *ServerInterfaceMock) ErrorCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) GetEveryTypeOptional(ctx echo.Context) (*GetEveryTypeOptionalResponse, error)
- func (mock *ServerInterfaceMock) GetEveryTypeOptionalCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) GetReservedKeyword(ctx echo.Context) (*GetReservedKeywordResponse, error)
- func (mock *ServerInterfaceMock) GetReservedKeywordCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) GetResponseWithReference(ctx echo.Context) (*GetResponseWithReferenceResponse, error)
- func (mock *ServerInterfaceMock) GetResponseWithReferenceCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) GetSimple(ctx echo.Context) (*GetSimpleResponse, error)
- func (mock *ServerInterfaceMock) GetSimpleCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) GetWithArgs(ctx echo.Context, params GetWithArgsParams) (*GetWithArgsResponse, error)
- func (mock *ServerInterfaceMock) GetWithArgsCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) GetWithContentType(ctx echo.Context, contentType GetWithContentTypeParamsContentType) (*GetWithContentTypeResponse, error)
- func (mock *ServerInterfaceMock) GetWithContentTypeCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) GetWithReferences(ctx echo.Context, globalArgument int64, argument string) (*GetWithReferencesResponse, error)
- func (mock *ServerInterfaceMock) GetWithReferencesCalls() []struct{ ... }
- func (mock *ServerInterfaceMock) UpdateResource3(ctx echo.Context, pFallthrough int, requestBody UpdateResource3JSONBody) (int, error)
- func (mock *ServerInterfaceMock) UpdateResource3Calls() []struct{ ... }
- type ServerInterfaceWrapper
- func (w *ServerInterfaceWrapper) CreateEveryTypeOptional(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) CreateResource(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) CreateResource2(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetEveryTypeOptional(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetReservedKeyword(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetResponseWithReference(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetSimple(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetWithArgs(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetWithContentType(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetWithReferences(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) UpdateResource3(ctx echo.Context) error
- type SimpleResponse
- type SomeObject
- type UpdateResource3JSONBody
- type UpdateResource3JSONRequestBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(router EchoRouter, si ServerInterface, admin echo.MiddlewareFunc, premium echo.MiddlewareFunc, m ...echo.MiddlewareFunc)
RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlersWithBaseURL ¶
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string, admin echo.MiddlewareFunc, premium echo.MiddlewareFunc, m ...echo.MiddlewareFunc)
Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.
Types ¶
type CreateEveryTypeOptionalJSONBody ¶
type CreateEveryTypeOptionalJSONBody = EveryTypeOptional
CreateEveryTypeOptionalJSONBody defines parameters for CreateEveryTypeOptional.
type CreateEveryTypeOptionalJSONRequestBody ¶
type CreateEveryTypeOptionalJSONRequestBody = CreateEveryTypeOptionalJSONBody
CreateEveryTypeOptionalJSONRequestBody defines body for CreateEveryTypeOptional for application/json ContentType.
type CreateEveryTypeOptionalParams ¶ added in v2.0.3
type CreateEveryTypeOptionalParams struct {
EnumType *CustomEnumType `form:"enum_type,omitempty" json:"enum_type,omitempty" validate:"omitempty,oneof=first second"`
}
CreateEveryTypeOptionalParams defines parameters for CreateEveryTypeOptional.
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 `form:"inline_query_argument,omitempty" json:"inline_query_argument,omitempty"`
}
CreateResource2Params defines parameters for CreateResource2.
type CreateResource2Response ¶
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 CreateResourceResponse ¶
type CustomEnumType ¶ added in v2.0.3
type CustomEnumType string
type EchoRouter ¶
type EchoRouter interface {
CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}
This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration
type EchoRouterMock ¶ added in v2.0.2
type EchoRouterMock struct {
// CONNECTFunc mocks the CONNECT method.
CONNECTFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// DELETEFunc mocks the DELETE method.
DELETEFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// GETFunc mocks the GET method.
GETFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// HEADFunc mocks the HEAD method.
HEADFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// OPTIONSFunc mocks the OPTIONS method.
OPTIONSFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// PATCHFunc mocks the PATCH method.
PATCHFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// POSTFunc mocks the POST method.
POSTFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// PUTFunc mocks the PUT method.
PUTFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// TRACEFunc mocks the TRACE method.
TRACEFunc func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
// contains filtered or unexported fields
}
EchoRouterMock is a mock implementation of EchoRouter.
func TestSomethingThatUsesEchoRouter(t *testing.T) {
// make and configure a mocked EchoRouter
mockedEchoRouter := &EchoRouterMock{
CONNECTFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
panic("mock out the CONNECT method")
},
DELETEFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
panic("mock out the DELETE method")
},
GETFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
panic("mock out the GET method")
},
HEADFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
panic("mock out the HEAD method")
},
OPTIONSFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
panic("mock out the OPTIONS method")
},
PATCHFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
panic("mock out the PATCH method")
},
POSTFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
panic("mock out the POST method")
},
PUTFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
panic("mock out the PUT method")
},
TRACEFunc: func(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route {
panic("mock out the TRACE method")
},
}
// use mockedEchoRouter in code that requires EchoRouter
// and then make assertions.
}
func (*EchoRouterMock) CONNECT ¶ added in v2.0.2
func (mock *EchoRouterMock) CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
CONNECT calls CONNECTFunc.
func (*EchoRouterMock) CONNECTCalls ¶ added in v2.0.2
func (mock *EchoRouterMock) CONNECTCalls() []struct { Path string H echo.HandlerFunc M []echo.MiddlewareFunc }
CONNECTCalls gets all the calls that were made to CONNECT. Check the length with:
len(mockedEchoRouter.CONNECTCalls())
func (*EchoRouterMock) DELETE ¶ added in v2.0.2
func (mock *EchoRouterMock) DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
DELETE calls DELETEFunc.
func (*EchoRouterMock) DELETECalls ¶ added in v2.0.2
func (mock *EchoRouterMock) DELETECalls() []struct { Path string H echo.HandlerFunc M []echo.MiddlewareFunc }
DELETECalls gets all the calls that were made to DELETE. Check the length with:
len(mockedEchoRouter.DELETECalls())
func (*EchoRouterMock) GET ¶ added in v2.0.2
func (mock *EchoRouterMock) GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
GET calls GETFunc.
func (*EchoRouterMock) GETCalls ¶ added in v2.0.2
func (mock *EchoRouterMock) GETCalls() []struct { Path string H echo.HandlerFunc M []echo.MiddlewareFunc }
GETCalls gets all the calls that were made to GET. Check the length with:
len(mockedEchoRouter.GETCalls())
func (*EchoRouterMock) HEAD ¶ added in v2.0.2
func (mock *EchoRouterMock) HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
HEAD calls HEADFunc.
func (*EchoRouterMock) HEADCalls ¶ added in v2.0.2
func (mock *EchoRouterMock) HEADCalls() []struct { Path string H echo.HandlerFunc M []echo.MiddlewareFunc }
HEADCalls gets all the calls that were made to HEAD. Check the length with:
len(mockedEchoRouter.HEADCalls())
func (*EchoRouterMock) OPTIONS ¶ added in v2.0.2
func (mock *EchoRouterMock) OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
OPTIONS calls OPTIONSFunc.
func (*EchoRouterMock) OPTIONSCalls ¶ added in v2.0.2
func (mock *EchoRouterMock) OPTIONSCalls() []struct { Path string H echo.HandlerFunc M []echo.MiddlewareFunc }
OPTIONSCalls gets all the calls that were made to OPTIONS. Check the length with:
len(mockedEchoRouter.OPTIONSCalls())
func (*EchoRouterMock) PATCH ¶ added in v2.0.2
func (mock *EchoRouterMock) PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PATCH calls PATCHFunc.
func (*EchoRouterMock) PATCHCalls ¶ added in v2.0.2
func (mock *EchoRouterMock) PATCHCalls() []struct { Path string H echo.HandlerFunc M []echo.MiddlewareFunc }
PATCHCalls gets all the calls that were made to PATCH. Check the length with:
len(mockedEchoRouter.PATCHCalls())
func (*EchoRouterMock) POST ¶ added in v2.0.2
func (mock *EchoRouterMock) POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
POST calls POSTFunc.
func (*EchoRouterMock) POSTCalls ¶ added in v2.0.2
func (mock *EchoRouterMock) POSTCalls() []struct { Path string H echo.HandlerFunc M []echo.MiddlewareFunc }
POSTCalls gets all the calls that were made to POST. Check the length with:
len(mockedEchoRouter.POSTCalls())
func (*EchoRouterMock) PUT ¶ added in v2.0.2
func (mock *EchoRouterMock) PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PUT calls PUTFunc.
func (*EchoRouterMock) PUTCalls ¶ added in v2.0.2
func (mock *EchoRouterMock) PUTCalls() []struct { Path string H echo.HandlerFunc M []echo.MiddlewareFunc }
PUTCalls gets all the calls that were made to PUT. Check the length with:
len(mockedEchoRouter.PUTCalls())
func (*EchoRouterMock) TRACE ¶ added in v2.0.2
func (mock *EchoRouterMock) TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
TRACE calls TRACEFunc.
func (*EchoRouterMock) TRACECalls ¶ added in v2.0.2
func (mock *EchoRouterMock) TRACECalls() []struct { Path string H echo.HandlerFunc M []echo.MiddlewareFunc }
TRACECalls gets all the calls that were made to TRACE. Check the length with:
len(mockedEchoRouter.TRACECalls())
type Error ¶
type Error struct {
Message string `json:"message" validate:"required"`
}
Error defines model for Error.
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"`
CountryField *string `json:"country_field,omitempty" validate:"omitempty,iso3166_1_alpha2"`
DateField *openapi_types.Date `json:"date_field,omitempty"`
DateTimeField *time.Time `json:"date_time_field,omitempty"`
DoubleField *float64 `json:"double_field,omitempty"`
EnumField *CustomEnumType `json:"enum_field,omitempty" validate:"omitempty,oneof=first second"`
FloatField *float32 `json:"float_field,omitempty" validate:"omitempty,min=1.5,max=5.5"`
InlineObjectField *struct {
Name string `json:"name" validate:"required"`
Number int `json:"number" validate:"required"`
} `json:"inline_object_field,omitempty"`
Int32Field *int32 `json:"int32_field,omitempty"`
Int64Field *int64 `json:"int64_field,omitempty"`
IntField *int `json:"int_field,omitempty" validate:"omitempty,min=1,max=5"`
NumberField *float32 `json:"number_field,omitempty"`
PatternField *string `json:"pattern_field,omitempty" validate:"omitempty,pattern=KFtcd117Mn0pXyhbXHddezJ9KQ=="`
ReferencedField *SomeObject `json:"referenced_field,omitempty"`
StringField *string `json:"string_field,omitempty" validate:"omitempty,min=1,max=5"`
}
EveryTypeOptional defines model for EveryTypeOptional.
type EveryTypeRequired ¶
type EveryTypeRequired struct {
ArrayInlineField []int `json:"array_inline_field" validate:"required"`
ArrayReferencedField []SomeObject `json:"array_referenced_field" validate:"required"`
BoolField bool `json:"bool_field" validate:"required"`
ByteField []byte `json:"byte_field" validate:"required"`
DateField openapi_types.Date `json:"date_field" validate:"required"`
DateTimeField time.Time `json:"date_time_field" validate:"required"`
DoubleField float64 `json:"double_field" validate:"required"`
EmailField *openapi_types.Email `json:"email_field,omitempty"`
FloatField float32 `json:"float_field" validate:"required"`
InlineObjectField struct {
Name string `json:"name" validate:"required"`
Number int `json:"number" validate:"required"`
} `json:"inline_object_field" validate:"required"`
Int32Field int32 `json:"int32_field" validate:"required"`
Int64Field int64 `json:"int64_field" validate:"required"`
IntField int `json:"int_field" validate:"required"`
NumberField float32 `json:"number_field" validate:"required"`
ReferencedField SomeObject `json:"referenced_field" validate:"required"`
StringField string `json:"string_field" validate:"required"`
}
EveryTypeRequired defines model for EveryTypeRequired.
type GetEveryTypeOptionalResponse ¶
type GetEveryTypeOptionalResponse struct {
Code int
JSON200 *EveryTypeOptional
}
type GetReservedKeywordResponse ¶
type GetReservedKeywordResponse struct {
Code int
JSON200 *ReservedKeyword
}
type GetResponseWithReferenceResponse ¶
type GetResponseWithReferenceResponse struct {
Code int
JSON200 *SomeObject
}
type GetSimpleResponse ¶
type GetSimpleResponse struct {
Code int
JSON200 *SomeObject
}
type GetWithArgsParams ¶
type GetWithArgsParams struct {
// An optional query argument
OptionalArgument *int64 `form:"optional_argument,omitempty" json:"optional_argument,omitempty"`
// An optional query argument
RequiredArgument int64 `form:"required_argument" json:"required_argument" validate:"required"`
// An optional query argument
HeaderArgument *int32 `json:"header_argument,omitempty"`
}
GetWithArgsParams defines parameters for GetWithArgs.
type GetWithArgsResponse ¶
type GetWithContentTypeParamsContentType ¶
type GetWithContentTypeParamsContentType string
GetWithContentTypeParamsContentType defines parameters for GetWithContentType.
type GetWithContentTypeResponse ¶
type GetWithContentTypeResponse struct {
Code int
JSON200 *SomeObject
}
type ReservedKeyword ¶
type ReservedKeyword struct {
Channel *string `json:"channel,omitempty"`
}
ReservedKeyword defines model for ReservedKeyword.
type Resource ¶
type Resource struct {
FloatFieldDefault float32 `default:"5.5" json:"float_field_default,omitempty"`
IntFieldDefault int `default:"5" json:"int_field_default,omitempty"`
Name string `json:"name" validate:"required"`
Value float32 `json:"value" validate:"required"`
}
Resource defines model for Resource.
type ResponseWithReference ¶
type ResponseWithReference = SomeObject
ResponseWithReference defines model for ResponseWithReference.
type ServerInterface ¶
type ServerInterface interface {
// get every type optional
// (GET /every-type-optional)
GetEveryTypeOptional(ctx echo.Context) (resp *GetEveryTypeOptionalResponse, err error)
// create every type optional
// (POST /every-type-optional)
CreateEveryTypeOptional(ctx echo.Context, params CreateEveryTypeOptionalParams, requestBody CreateEveryTypeOptionalJSONBody) (code int, err error)
// Get resource via simple path
// (GET /get-simple)
GetSimple(ctx echo.Context) (resp *GetSimpleResponse, err error)
// Getter with referenced parameter and referenced response
// (GET /get-with-args)
GetWithArgs(ctx echo.Context, params GetWithArgsParams) (resp *GetWithArgsResponse, err error)
// Getter with referenced parameter and referenced response
// (GET /get-with-references/{global_argument}/{argument})
GetWithReferences(ctx echo.Context, globalArgument int64, argument Argument) (resp *GetWithReferencesResponse, err error)
// Get an object by ID
// (GET /get-with-type/{content_type})
GetWithContentType(ctx echo.Context, contentType GetWithContentTypeParamsContentType) (resp *GetWithContentTypeResponse, err error)
// get with reserved keyword
// (GET /reserved-keyword)
GetReservedKeyword(ctx echo.Context) (resp *GetReservedKeywordResponse, err error)
// Create a resource
// (POST /resource/{argument})
CreateResource(ctx echo.Context, argument Argument, requestBody CreateResourceJSONBody) (resp *CreateResourceResponse, err error)
// Create a resource with inline parameter
// (POST /resource2/{inline_argument})
CreateResource2(ctx echo.Context, inlineArgument int, params CreateResource2Params, requestBody CreateResource2JSONBody) (resp *CreateResource2Response, err error)
// 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(ctx echo.Context, pFallthrough int, requestBody UpdateResource3JSONBody) (code int, err error)
// get response with reference
// (GET /response-with-reference)
GetResponseWithReference(ctx echo.Context) (resp *GetResponseWithReferenceResponse, err error)
Error(err error) (status int, resp Error)
}
ServerInterface represents all server handlers.
type ServerInterfaceMock ¶
type ServerInterfaceMock struct {
// CreateEveryTypeOptionalFunc mocks the CreateEveryTypeOptional method.
CreateEveryTypeOptionalFunc func(ctx echo.Context, params CreateEveryTypeOptionalParams, requestBody EveryTypeOptional) (int, error)
// CreateResourceFunc mocks the CreateResource method.
CreateResourceFunc func(ctx echo.Context, argument string, requestBody EveryTypeRequired) (*CreateResourceResponse, error)
// CreateResource2Func mocks the CreateResource2 method.
CreateResource2Func func(ctx echo.Context, inlineArgument int, params CreateResource2Params, requestBody Resource) (*CreateResource2Response, error)
// ErrorFunc mocks the Error method.
ErrorFunc func(err error) (int, Error)
// GetEveryTypeOptionalFunc mocks the GetEveryTypeOptional method.
GetEveryTypeOptionalFunc func(ctx echo.Context) (*GetEveryTypeOptionalResponse, error)
// GetReservedKeywordFunc mocks the GetReservedKeyword method.
GetReservedKeywordFunc func(ctx echo.Context) (*GetReservedKeywordResponse, error)
// GetResponseWithReferenceFunc mocks the GetResponseWithReference method.
GetResponseWithReferenceFunc func(ctx echo.Context) (*GetResponseWithReferenceResponse, error)
// GetSimpleFunc mocks the GetSimple method.
GetSimpleFunc func(ctx echo.Context) (*GetSimpleResponse, error)
// GetWithArgsFunc mocks the GetWithArgs method.
GetWithArgsFunc func(ctx echo.Context, params GetWithArgsParams) (*GetWithArgsResponse, error)
// GetWithContentTypeFunc mocks the GetWithContentType method.
GetWithContentTypeFunc func(ctx echo.Context, contentType GetWithContentTypeParamsContentType) (*GetWithContentTypeResponse, error)
// GetWithReferencesFunc mocks the GetWithReferences method.
GetWithReferencesFunc func(ctx echo.Context, globalArgument int64, argument string) (*GetWithReferencesResponse, error)
// UpdateResource3Func mocks the UpdateResource3 method.
UpdateResource3Func func(ctx echo.Context, pFallthrough int, requestBody UpdateResource3JSONBody) (int, error)
// 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{
CreateEveryTypeOptionalFunc: func(ctx echo.Context, params CreateEveryTypeOptionalParams, requestBody EveryTypeOptional) (int, error) {
panic("mock out the CreateEveryTypeOptional method")
},
CreateResourceFunc: func(ctx echo.Context, argument string, requestBody EveryTypeRequired) (*CreateResourceResponse, error) {
panic("mock out the CreateResource method")
},
CreateResource2Func: func(ctx echo.Context, inlineArgument int, params CreateResource2Params, requestBody Resource) (*CreateResource2Response, error) {
panic("mock out the CreateResource2 method")
},
ErrorFunc: func(err error) (int, Error) {
panic("mock out the Error method")
},
GetEveryTypeOptionalFunc: func(ctx echo.Context) (*GetEveryTypeOptionalResponse, error) {
panic("mock out the GetEveryTypeOptional method")
},
GetReservedKeywordFunc: func(ctx echo.Context) (*GetReservedKeywordResponse, error) {
panic("mock out the GetReservedKeyword method")
},
GetResponseWithReferenceFunc: func(ctx echo.Context) (*GetResponseWithReferenceResponse, error) {
panic("mock out the GetResponseWithReference method")
},
GetSimpleFunc: func(ctx echo.Context) (*GetSimpleResponse, error) {
panic("mock out the GetSimple method")
},
GetWithArgsFunc: func(ctx echo.Context, params GetWithArgsParams) (*GetWithArgsResponse, error) {
panic("mock out the GetWithArgs method")
},
GetWithContentTypeFunc: func(ctx echo.Context, contentType GetWithContentTypeParamsContentType) (*GetWithContentTypeResponse, error) {
panic("mock out the GetWithContentType method")
},
GetWithReferencesFunc: func(ctx echo.Context, globalArgument int64, argument string) (*GetWithReferencesResponse, error) {
panic("mock out the GetWithReferences method")
},
UpdateResource3Func: func(ctx echo.Context, pFallthrough int, requestBody UpdateResource3JSONBody) (int, error) {
panic("mock out the UpdateResource3 method")
},
}
// use mockedServerInterface in code that requires ServerInterface
// and then make assertions.
}
func (*ServerInterfaceMock) CreateEveryTypeOptional ¶
func (mock *ServerInterfaceMock) CreateEveryTypeOptional(ctx echo.Context, params CreateEveryTypeOptionalParams, requestBody EveryTypeOptional) (int, error)
CreateEveryTypeOptional calls CreateEveryTypeOptionalFunc.
func (*ServerInterfaceMock) CreateEveryTypeOptionalCalls ¶
func (mock *ServerInterfaceMock) CreateEveryTypeOptionalCalls() []struct { Ctx echo.Context Params CreateEveryTypeOptionalParams RequestBody EveryTypeOptional }
CreateEveryTypeOptionalCalls gets all the calls that were made to CreateEveryTypeOptional. Check the length with:
len(mockedServerInterface.CreateEveryTypeOptionalCalls())
func (*ServerInterfaceMock) CreateResource ¶
func (mock *ServerInterfaceMock) CreateResource(ctx echo.Context, argument string, requestBody EveryTypeRequired) (*CreateResourceResponse, error)
CreateResource calls CreateResourceFunc.
func (*ServerInterfaceMock) CreateResource2 ¶
func (mock *ServerInterfaceMock) CreateResource2(ctx echo.Context, inlineArgument int, params CreateResource2Params, requestBody Resource) (*CreateResource2Response, error)
CreateResource2 calls CreateResource2Func.
func (*ServerInterfaceMock) CreateResource2Calls ¶
func (mock *ServerInterfaceMock) CreateResource2Calls() []struct { Ctx echo.Context InlineArgument int Params CreateResource2Params RequestBody Resource }
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 { Ctx echo.Context Argument string RequestBody EveryTypeRequired }
CreateResourceCalls gets all the calls that were made to CreateResource. Check the length with:
len(mockedServerInterface.CreateResourceCalls())
func (*ServerInterfaceMock) Error ¶
func (mock *ServerInterfaceMock) Error(err error) (int, Error)
Error calls ErrorFunc.
func (*ServerInterfaceMock) ErrorCalls ¶
func (mock *ServerInterfaceMock) ErrorCalls() []struct { Err error }
ErrorCalls gets all the calls that were made to Error. Check the length with:
len(mockedServerInterface.ErrorCalls())
func (*ServerInterfaceMock) GetEveryTypeOptional ¶
func (mock *ServerInterfaceMock) GetEveryTypeOptional(ctx echo.Context) (*GetEveryTypeOptionalResponse, error)
GetEveryTypeOptional calls GetEveryTypeOptionalFunc.
func (*ServerInterfaceMock) GetEveryTypeOptionalCalls ¶
func (mock *ServerInterfaceMock) GetEveryTypeOptionalCalls() []struct { Ctx echo.Context }
GetEveryTypeOptionalCalls gets all the calls that were made to GetEveryTypeOptional. Check the length with:
len(mockedServerInterface.GetEveryTypeOptionalCalls())
func (*ServerInterfaceMock) GetReservedKeyword ¶
func (mock *ServerInterfaceMock) GetReservedKeyword(ctx echo.Context) (*GetReservedKeywordResponse, error)
GetReservedKeyword calls GetReservedKeywordFunc.
func (*ServerInterfaceMock) GetReservedKeywordCalls ¶
func (mock *ServerInterfaceMock) GetReservedKeywordCalls() []struct { Ctx echo.Context }
GetReservedKeywordCalls gets all the calls that were made to GetReservedKeyword. Check the length with:
len(mockedServerInterface.GetReservedKeywordCalls())
func (*ServerInterfaceMock) GetResponseWithReference ¶
func (mock *ServerInterfaceMock) GetResponseWithReference(ctx echo.Context) (*GetResponseWithReferenceResponse, error)
GetResponseWithReference calls GetResponseWithReferenceFunc.
func (*ServerInterfaceMock) GetResponseWithReferenceCalls ¶
func (mock *ServerInterfaceMock) GetResponseWithReferenceCalls() []struct { Ctx echo.Context }
GetResponseWithReferenceCalls gets all the calls that were made to GetResponseWithReference. Check the length with:
len(mockedServerInterface.GetResponseWithReferenceCalls())
func (*ServerInterfaceMock) GetSimple ¶
func (mock *ServerInterfaceMock) GetSimple(ctx echo.Context) (*GetSimpleResponse, error)
GetSimple calls GetSimpleFunc.
func (*ServerInterfaceMock) GetSimpleCalls ¶
func (mock *ServerInterfaceMock) GetSimpleCalls() []struct { Ctx echo.Context }
GetSimpleCalls gets all the calls that were made to GetSimple. Check the length with:
len(mockedServerInterface.GetSimpleCalls())
func (*ServerInterfaceMock) GetWithArgs ¶
func (mock *ServerInterfaceMock) GetWithArgs(ctx echo.Context, params GetWithArgsParams) (*GetWithArgsResponse, error)
GetWithArgs calls GetWithArgsFunc.
func (*ServerInterfaceMock) GetWithArgsCalls ¶
func (mock *ServerInterfaceMock) GetWithArgsCalls() []struct { Ctx echo.Context 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(ctx echo.Context, contentType GetWithContentTypeParamsContentType) (*GetWithContentTypeResponse, error)
GetWithContentType calls GetWithContentTypeFunc.
func (*ServerInterfaceMock) GetWithContentTypeCalls ¶
func (mock *ServerInterfaceMock) GetWithContentTypeCalls() []struct { Ctx echo.Context 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(ctx echo.Context, globalArgument int64, argument string) (*GetWithReferencesResponse, error)
GetWithReferences calls GetWithReferencesFunc.
func (*ServerInterfaceMock) GetWithReferencesCalls ¶
func (mock *ServerInterfaceMock) GetWithReferencesCalls() []struct { Ctx echo.Context GlobalArgument int64 Argument string }
GetWithReferencesCalls gets all the calls that were made to GetWithReferences. Check the length with:
len(mockedServerInterface.GetWithReferencesCalls())
func (*ServerInterfaceMock) UpdateResource3 ¶
func (mock *ServerInterfaceMock) UpdateResource3(ctx echo.Context, pFallthrough int, requestBody UpdateResource3JSONBody) (int, error)
UpdateResource3 calls UpdateResource3Func.
func (*ServerInterfaceMock) UpdateResource3Calls ¶
func (mock *ServerInterfaceMock) UpdateResource3Calls() []struct { Ctx echo.Context PFallthrough int RequestBody UpdateResource3JSONBody }
UpdateResource3Calls gets all the calls that were made to UpdateResource3. Check the length with:
len(mockedServerInterface.UpdateResource3Calls())
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) CreateEveryTypeOptional ¶
func (w *ServerInterfaceWrapper) CreateEveryTypeOptional(ctx echo.Context) error
CreateEveryTypeOptional converts echo context to params.
func (*ServerInterfaceWrapper) CreateResource ¶
func (w *ServerInterfaceWrapper) CreateResource(ctx echo.Context) error
CreateResource converts echo context to params.
func (*ServerInterfaceWrapper) CreateResource2 ¶
func (w *ServerInterfaceWrapper) CreateResource2(ctx echo.Context) error
CreateResource2 converts echo context to params.
func (*ServerInterfaceWrapper) GetEveryTypeOptional ¶
func (w *ServerInterfaceWrapper) GetEveryTypeOptional(ctx echo.Context) error
GetEveryTypeOptional converts echo context to params.
func (*ServerInterfaceWrapper) GetReservedKeyword ¶
func (w *ServerInterfaceWrapper) GetReservedKeyword(ctx echo.Context) error
GetReservedKeyword converts echo context to params.
func (*ServerInterfaceWrapper) GetResponseWithReference ¶
func (w *ServerInterfaceWrapper) GetResponseWithReference(ctx echo.Context) error
GetResponseWithReference converts echo context to params.
func (*ServerInterfaceWrapper) GetSimple ¶
func (w *ServerInterfaceWrapper) GetSimple(ctx echo.Context) error
GetSimple converts echo context to params.
func (*ServerInterfaceWrapper) GetWithArgs ¶
func (w *ServerInterfaceWrapper) GetWithArgs(ctx echo.Context) error
GetWithArgs converts echo context to params.
func (*ServerInterfaceWrapper) GetWithContentType ¶
func (w *ServerInterfaceWrapper) GetWithContentType(ctx echo.Context) error
GetWithContentType converts echo context to params.
func (*ServerInterfaceWrapper) GetWithReferences ¶
func (w *ServerInterfaceWrapper) GetWithReferences(ctx echo.Context) error
GetWithReferences converts echo context to params.
func (*ServerInterfaceWrapper) UpdateResource3 ¶
func (w *ServerInterfaceWrapper) UpdateResource3(ctx echo.Context) error
UpdateResource3 converts echo context to params.
type SimpleResponse ¶
type SimpleResponse struct {
Name string `json:"name" validate:"required"`
}
SimpleResponse defines model for SimpleResponse.
type SomeObject ¶
type SomeObject struct {
Name string `json:"name" validate:"required"`
}
SomeObject defines model for some_object.
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.