test

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SpecFile string = `` /* 2695-byte string literal not displayed */

Variables

View Source
var LogError = func(err error) {
	log.Println(fmt.Sprintf("Error: %v", err))
}

Functions

func SchemaPath

func SchemaPath(r *http.Request) (string, bool)

func SpecFileHandler

func SpecFileHandler() http.Handler

Types

type API

type API struct {
	PostShopsShopStringSepShopSchemaPetsHandler PostShopsShopStringSepShopSchemaPetsHandlerFunc

	// not found
	NotFoundHandler http.Handler
	// spec file
	SpecFileHandler http.Handler

	Middlewares []func(h http.Handler) http.Handler
}

func (*API) ServeHTTP

func (rt *API) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type Client

type Client struct {
	BaseURL    string
	HTTPClient HTTPClient
}

func NewClient

func NewClient(baseURL string, httpClient HTTPClient) *Client

func (*Client) PostShopsShopStringSepShopSchemaPets

PostShopsShopStringSepShopSchemaPets - POST /shops/{shop_string}/sep/{shop_schema}/pets

type ErrParseParam

type ErrParseParam struct {
	In        string
	Parameter string
	Reason    string
	Err       error
}

func (ErrParseParam) Error

func (e ErrParseParam) Error() string

func (ErrParseParam) Unwrap

func (e ErrParseParam) Unwrap() error

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)
}

type HTTPClientFunc

type HTTPClientFunc func(*http.Request) (*http.Response, error)

func (HTTPClientFunc) Do

type Maybe added in v0.1.5

type Maybe[T any] struct {
	IsSet bool
	Value T
}

func Just added in v0.1.5

func Just[T any](v T) Maybe[T]

func (*Maybe[T]) Set added in v0.1.6

func (m *Maybe[T]) Set(v T)

type Organization

type Organization int

func (*Organization) Parse

func (c *Organization) Parse(s string) error

func (Organization) String

func (q Organization) String() string

type Page

type Page int32

func (*Page) Parse

func (c *Page) Parse(s string) error

func (Page) String

func (q Page) String() string

type Pages added in v0.1.4

type Pages []int32

func (*Pages) ParseStrings added in v0.1.4

func (c *Pages) ParseStrings(s []string) error

func (Pages) Strings added in v0.1.4

func (q Pages) Strings() []string

type PostShopsShopStringSepShopSchemaPetsHandlerFunc

type PostShopsShopStringSepShopSchemaPetsHandlerFunc func(ctx context.Context, r PostShopsShopStringSepShopSchemaPetsRequest) PostShopsShopStringSepShopSchemaPetsResponse

func (PostShopsShopStringSepShopSchemaPetsHandlerFunc) ServeHTTP

type PostShopsShopStringSepShopSchemaPetsParams

type PostShopsShopStringSepShopSchemaPetsParams struct {
	Query struct {
		PageInt Maybe[int]

		PageSchema Maybe[Page]

		PagesSchema Maybe[Pages]

		PageIntReq int

		PageSchemaReq Page
	}

	Path struct {
		ShopString string

		ShopSchema Shop
	}

	Headers struct {
		XOrganizationInt Maybe[int]

		XOrganizationSchema Maybe[Organization]

		XOrganizationIntRequired int

		XOrganizationSchemaRequired Organization
	}
}

func (PostShopsShopStringSepShopSchemaPetsParams) HTTP

func (PostShopsShopStringSepShopSchemaPetsParams) Parse

type PostShopsShopStringSepShopSchemaPetsRequest

type PostShopsShopStringSepShopSchemaPetsRequest interface {
	HTTP() *http.Request
	Parse() (PostShopsShopStringSepShopSchemaPetsParams, error)
}

type PostShopsShopStringSepShopSchemaPetsResponse

type PostShopsShopStringSepShopSchemaPetsResponse interface {
	Write(w http.ResponseWriter)
	// contains filtered or unexported methods
}

func NewPostShopsShopStringSepShopSchemaPetsResponse200

func NewPostShopsShopStringSepShopSchemaPetsResponse200() PostShopsShopStringSepShopSchemaPetsResponse

type PostShopsShopStringSepShopSchemaPetsResponse200

type PostShopsShopStringSepShopSchemaPetsResponse200 struct{}

PostShopsShopStringSepShopSchemaPetsResponse200 - OK response

func (PostShopsShopStringSepShopSchemaPetsResponse200) Write

type Shop

type Shop Shopa

func (*Shop) Parse

func (c *Shop) Parse(s string) error

func (Shop) String

func (q Shop) String() string

type Shopa added in v0.1.4

type Shopa string

func (*Shopa) Parse added in v0.1.4

func (c *Shopa) Parse(s string) error

func (Shopa) String added in v0.1.4

func (q Shopa) String() string

type Shops added in v0.1.4

type Shops []string

func (*Shops) ParseStrings added in v0.1.4

func (c *Shops) ParseStrings(s []string) error

func (Shops) Strings added in v0.1.4

func (q Shops) Strings() []string

Jump to

Keyboard shortcuts

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