test

package
v0.1.31 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const SpecFile string = `` /* 2497-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 {
	GetShopsShopHandler GetShopsShopHandlerFunc

	// 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)

func (API) TestClient added in v0.1.28

func (a API) TestClient() *Client

type Client

type Client struct {
	BaseURL    string
	HTTPClient HTTPClient
}

func NewClient

func NewClient(baseURL string, httpClient HTTPClient) *Client

func (*Client) GetShopsShop

func (c *Client) GetShopsShop(ctx context.Context, request GetShopsShopParams) (GetShopsShopResponse, error)

GetShopsShop GET /shops/{shop}

type Environment added in v0.1.29

type Environment struct {
	Name  string
	Value string
}

func (Environment) MarshalJSON added in v0.1.31

func (c Environment) MarshalJSON() ([]byte, error)

func (*Environment) UnmarshalJSON added in v0.1.31

func (c *Environment) UnmarshalJSON(bs []byte) error

type Environment_Schema added in v0.1.31

type Environment_Schema struct {
	Name  string
	Value string
}

func (Environment_Schema) MarshalJSON added in v0.1.31

func (c Environment_Schema) MarshalJSON() ([]byte, error)

func (*Environment_Schema) UnmarshalJSON added in v0.1.31

func (c *Environment_Schema) UnmarshalJSON(bs []byte) error

type Environments added in v0.1.29

type Environments []pkg.Environment

func (Environments) MarshalJSON added in v0.1.31

func (c Environments) MarshalJSON() ([]byte, error)

func (*Environments) UnmarshalJSON added in v0.1.31

func (c *Environments) UnmarshalJSON(bs []byte) error

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 GetShop added in v0.1.29

type GetShop struct {
	Additionals  pkg.Maybe[pkg.Nullable[pkg.Settings]]
	Environments pkg.Maybe[pkg.Nullable[Environments]]
	Metadata     pkg.Metadata
	Settings     pkg.Maybe[pkg.Nullable[pkg.Settings]]
}

func (GetShop) MarshalJSON added in v0.1.29

func (c GetShop) MarshalJSON() ([]byte, error)

func (*GetShop) UnmarshalJSON added in v0.1.29

func (c *GetShop) UnmarshalJSON(bs []byte) error

type GetShopAdditionals added in v0.1.31

type GetShopAdditionals struct {
	AdditionalProperties map[string]any
}

func (GetShopAdditionals) MarshalJSON added in v0.1.31

func (c GetShopAdditionals) MarshalJSON() ([]byte, error)

func (*GetShopAdditionals) UnmarshalJSON added in v0.1.31

func (c *GetShopAdditionals) UnmarshalJSON(bs []byte) error

type GetShopAdditionals_Schema added in v0.1.31

type GetShopAdditionals_Schema struct {
	AdditionalProperties map[string]any
}

func (GetShopAdditionals_Schema) MarshalJSON added in v0.1.31

func (c GetShopAdditionals_Schema) MarshalJSON() ([]byte, error)

func (*GetShopAdditionals_Schema) UnmarshalJSON added in v0.1.31

func (c *GetShopAdditionals_Schema) UnmarshalJSON(bs []byte) error

type GetShopsShopHandlerFunc

type GetShopsShopHandlerFunc func(ctx context.Context, r GetShopsShopRequest) GetShopsShopResponse

func (GetShopsShopHandlerFunc) ServeHTTP

type GetShopsShopParams

type GetShopsShopParams struct {
	Query GetShopsShopParamsQuery

	Path GetShopsShopParamsPath

	Body GetShop
}

func (GetShopsShopParams) HTTP

func (r GetShopsShopParams) HTTP() *http.Request

func (GetShopsShopParams) Parse

type GetShopsShopParamsPath added in v0.1.18

type GetShopsShopParamsPath struct {
	Shop pkg.Shop
}

type GetShopsShopParamsQuery added in v0.1.18

type GetShopsShopParamsQuery struct {
	PageSchemaRefQuery pkg.Maybe[pkg.Page]

	PageCustomTypeQuery pkg.Maybe[pkg.PageCustomTypeQuery]
}

type GetShopsShopRequest

type GetShopsShopRequest interface {
	HTTP() *http.Request
	Parse() (GetShopsShopParams, error)
}

func GetShopsShopHTTPRequest

func GetShopsShopHTTPRequest(r *http.Request) GetShopsShopRequest

type GetShopsShopResponse

type GetShopsShopResponse interface {
	// contains filtered or unexported methods
}

func NewGetShopsShopResponse200JSON

func NewGetShopsShopResponse200JSON(body Shop) GetShopsShopResponse

func NewGetShopsShopResponseDefault

func NewGetShopsShopResponseDefault(code int) GetShopsShopResponse

type GetShopsShopResponse200JSON

type GetShopsShopResponse200JSON struct {
	Body Shop
}

GetShopsShopResponse200JSON - Shop response

func (GetShopsShopResponse200JSON) Write

type GetShopsShopResponseDefault

type GetShopsShopResponseDefault struct {
	Code int
}

GetShopsShopResponseDefault - Error response

func (GetShopsShopResponseDefault) Write

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 Metadata added in v0.1.29

type Metadata struct {
	InnerID pkg.Maybe[string]
}

func (Metadata) MarshalJSON added in v0.1.31

func (c Metadata) MarshalJSON() ([]byte, error)

func (*Metadata) UnmarshalJSON added in v0.1.31

func (c *Metadata) UnmarshalJSON(bs []byte) error

type Metadata_Schema added in v0.1.31

type Metadata_Schema struct {
	InnerID pkg.Maybe[string]
}

func (Metadata_Schema) MarshalJSON added in v0.1.31

func (c Metadata_Schema) MarshalJSON() ([]byte, error)

func (*Metadata_Schema) UnmarshalJSON added in v0.1.31

func (c *Metadata_Schema) UnmarshalJSON(bs []byte) error

type PageCustom

type PageCustom string

func NewPageCustom added in v0.1.31

func NewPageCustom(v string) PageCustom

func (PageCustom) String added in v0.1.31

func (c PageCustom) String() string

type PageCustom_Schema added in v0.1.31

type PageCustom_Schema string

func NewPageCustom_Schema added in v0.1.31

func NewPageCustom_Schema(v string) PageCustom_Schema

func (PageCustom_Schema) String added in v0.1.31

func (c PageCustom_Schema) String() string

type Settings added in v0.1.29

type Settings struct {
	Theme pkg.Maybe[string]
}

func (Settings) MarshalJSON added in v0.1.31

func (c Settings) MarshalJSON() ([]byte, error)

func (*Settings) UnmarshalJSON added in v0.1.31

func (c *Settings) UnmarshalJSON(bs []byte) error

type Settings_Schema added in v0.1.31

type Settings_Schema struct {
	Theme pkg.Maybe[string]
}

func (Settings_Schema) MarshalJSON added in v0.1.31

func (c Settings_Schema) MarshalJSON() ([]byte, error)

func (*Settings_Schema) UnmarshalJSON added in v0.1.31

func (c *Settings_Schema) UnmarshalJSON(bs []byte) error

type Shop

type Shop ShopName

func NewShop added in v0.1.23

func NewShop(v ShopName) Shop

func (Shop) ShopName added in v0.1.23

func (c Shop) ShopName() ShopName

type ShopName

type ShopName int64

func NewShopName added in v0.1.31

func NewShopName(v int64) ShopName

func (ShopName) Int64 added in v0.1.31

func (c ShopName) Int64() int64

type ShopName_Schema added in v0.1.31

type ShopName_Schema int64

func NewShopName_Schema added in v0.1.31

func NewShopName_Schema(v int64) ShopName_Schema

func (ShopName_Schema) Int64 added in v0.1.31

func (c ShopName_Schema) Int64() int64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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