custom_templates

package
v2.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package custom_templates provides primitives to interact with the openapi HTTP API.

Code generated by github.com/KosyanMedia/oapi-codegen/v2 version (devel) DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface, m ...echo.MiddlewareFunc)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string, m ...echo.MiddlewareFunc)

Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.

Types

type Argument

type Argument string

Argument defines model for argument.

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 `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 `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 CustomArgument

type CustomArgument string

CustomArgument defines model for argument.

type CustomEnumType added in v2.0.3

type CustomEnumType string

type CustomError

type CustomError struct {
	Message string `json:"message" validate:"required"`
}

CustomError defines model for Error.

type CustomEveryTypeOptional

type CustomEveryTypeOptional 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"`
}

CustomEveryTypeOptional defines model for EveryTypeOptional.

type CustomEveryTypeRequired

type CustomEveryTypeRequired 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"`
}

CustomEveryTypeRequired defines model for EveryTypeRequired.

type CustomReservedKeyword

type CustomReservedKeyword struct {
	Channel *string `json:"channel,omitempty"`
}

CustomReservedKeyword defines model for ReservedKeyword.

type CustomResource

type CustomResource 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"`
}

CustomResource defines model for Resource.

type CustomResponseWithReference

type CustomResponseWithReference SomeObject

CustomResponseWithReference defines model for ResponseWithReference.

type CustomSimpleResponse

type CustomSimpleResponse struct {
	Name string `json:"name" validate:"required"`
}

CustomSimpleResponse defines model for SimpleResponse.

type CustomSomeObject

type CustomSomeObject struct {
	Name string `json:"name" validate:"required"`
}

CustomSomeObject defines model for some_object.

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 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 GetWithArgsParams

type GetWithArgsParams struct {
	// An optional query argument
	OptionalArgument *int64 `json:"optional_argument,omitempty"`

	// An optional query argument
	RequiredArgument int64 `json:"required_argument" validate:"required"`

	// 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 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) error
	// create every type optional
	// (POST /every-type-optional)
	CreateEveryTypeOptional(ctx echo.Context, params CreateEveryTypeOptionalParams) error
	// Get resource via simple path
	// (GET /get-simple)
	GetSimple(ctx echo.Context) error
	// Getter with referenced parameter and referenced response
	// (GET /get-with-args)
	GetWithArgs(ctx echo.Context, params GetWithArgsParams) error
	// Getter with referenced parameter and referenced response
	// (GET /get-with-references/{global_argument}/{argument})
	GetWithReferences(ctx echo.Context, globalArgument int64, argument Argument) error
	// Get an object by ID
	// (GET /get-with-type/{content_type})
	GetWithContentType(ctx echo.Context, contentType GetWithContentTypeParamsContentType) error
	// get with reserved keyword
	// (GET /reserved-keyword)
	GetReservedKeyword(ctx echo.Context) error
	// Create a resource
	// (POST /resource/{argument})
	CreateResource(ctx echo.Context, argument Argument) error
	// Create a resource with inline parameter
	// (POST /resource2/{inline_argument})
	CreateResource2(ctx echo.Context, inlineArgument int, params CreateResource2Params) 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) error
	// get response with reference
	// (GET /response-with-reference)
	GetResponseWithReference(ctx echo.Context) error
}

ServerInterface represents all server handlers.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL