routes

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BinaryRouter = courier.NewRouter(httptransport.Group("/binary"))
View Source
var CookieRouter = courier.NewRouter(httptransport.Group("/cookie"))
View Source
var FormsRouter = courier.NewRouter(httptransport.Group("/forms"))
View Source
var ProxyRouter = courier.NewRouter(httptransport.Group("/proxy"))
View Source
var RedirectRouter = courier.NewRouter(httptransport.Group("/redirect"))
View Source
var RestfulRouter = courier.NewRouter(httptransport.Group("/restful"))
View Source
var RootRouter = courier.NewRouter(httptransport.BasePath("/demo"))

Functions

This section is empty.

Types

type Cookie struct {
	httpx.MethodPost
	Token string `name:"token,omitempty" in:"cookie"`
}

func (*Cookie) Output

func (req *Cookie) Output(ctx context.Context) (interface{}, error)

type Create

type Create struct {
	httpx.MethodPost
	Data Data `in:"body"`
}

Create

func (Create) Output

func (req Create) Output(ctx context.Context) (interface{}, error)

type Data

type Data struct {
	ID        string         `json:"id"`
	Label     string         `json:"label"`
	PtrString *string        `json:"ptrString,omitempty"`
	SubData   *SubData       `json:"subData,omitempty"`
	Protocol  types.Protocol `json:"protocol,omitempty"`
}

func DataFromContext

func DataFromContext(ctx context.Context) *Data

type DataProvider

type DataProvider struct {
	ID string `name:"id" in:"path" validate:"@string[6,]"`
}

func (DataProvider) ContextKey

func (DataProvider) ContextKey() string

func (DataProvider) Output

func (req DataProvider) Output(ctx context.Context) (interface{}, error)

func (DataProvider) Path

func (DataProvider) Path() string

type DownloadFile

type DownloadFile struct {
	httpx.MethodGet
}

download file

func (DownloadFile) Output

func (req DownloadFile) Output(ctx context.Context) (interface{}, error)

func (DownloadFile) Path

func (DownloadFile) Path() string

type FormMultipartWithFile

type FormMultipartWithFile struct {
	httpx.MethodPost
	FormData struct {
		Map map[types.Protocol]int `name:"map,omitempty"`
		// @deprecated
		String string                `name:"string,omitempty"`
		Slice  []string              `name:"slice,omitempty"`
		Data   Data                  `name:"data,omitempty"`
		File   *multipart.FileHeader `name:"file"`
	} `in:"body" mime:"multipart"`
}

Form Multipart

func (FormMultipartWithFile) Output

func (req FormMultipartWithFile) Output(ctx context.Context) (resp interface{}, err error)

func (FormMultipartWithFile) Path

func (req FormMultipartWithFile) Path() string

type FormMultipartWithFiles

type FormMultipartWithFiles struct {
	httpx.MethodPost
	FormData struct {
		Files []*multipart.FileHeader `name:"files"`
	} `in:"body" mime:"multipart"`
}

Form Multipart With Files

func (FormMultipartWithFiles) Output

func (FormMultipartWithFiles) Output(ctx context.Context) (resp interface{}, err error)

func (FormMultipartWithFiles) Path

type FormURLEncoded

type FormURLEncoded struct {
	httpx.MethodPost
	FormData struct {
		String string   `name:"string"`
		Slice  []string `name:"slice"`
		Data   Data     `name:"data"`
	} `in:"body" mime:"urlencoded"`
}

Form URL Encoded

func (FormURLEncoded) Output

func (req FormURLEncoded) Output(ctx context.Context) (resp interface{}, err error)

func (FormURLEncoded) Path

func (FormURLEncoded) Path() string

type GetByID

type GetByID struct {
	httpx.MethodGet
	Protocol types.Protocol `name:"protocol,omitempty" in:"query"`
	Name     string         `name:"name,omitempty" in:"query"`
	Label    []string       `name:"label,omitempty" in:"query"`
}

get by id

func (GetByID) Output

func (req GetByID) Output(ctx context.Context) (interface{}, error)

type GetByJSON

type GetByJSON struct {
	httpx.MethodGet
}

func (GetByJSON) Path

func (GetByJSON) Path() string

type HealthCheck

type HealthCheck struct {
	httpx.MethodHead
	PullPolicy types.PullPolicy `name:"pullPolicy,omitempty" in:"query"`
}

func (HealthCheck) Output

func (HealthCheck) Output(ctx context.Context) (interface{}, error)

type IpInfo

type IpInfo struct {
	Country     string `json:"country" xml:"country"`
	CountryCode string `json:"countryCode" xml:"countryCode"`
}

type Proxy

type Proxy struct {
	httpx.MethodGet
}

func (Proxy) Output

func (Proxy) Output(ctx context.Context) (interface{}, error)

type ProxyV2

type ProxyV2 struct {
	httpx.MethodGet `basePath:"/demo/v2"`
}

func (ProxyV2) Output

func (ProxyV2) Output(ctx context.Context) (interface{}, error)

type Redirect

type Redirect struct {
	httpx.MethodGet
}

func (Redirect) Output

func (Redirect) Output(ctx context.Context) (interface{}, error)

type RedirectWhenError

type RedirectWhenError struct {
	httpx.MethodPost
}

func (RedirectWhenError) Output

func (RedirectWhenError) Output(ctx context.Context) (interface{}, error)

type RemoveByID

type RemoveByID struct {
	httpx.MethodDelete
}

remove by id

func (RemoveByID) Output

func (RemoveByID) Output(ctx context.Context) (interface{}, error)

type ShowImage

type ShowImage struct {
	httpx.MethodGet
}

show image

func (ShowImage) Output

func (req ShowImage) Output(ctx context.Context) (interface{}, error)

func (ShowImage) Path

func (ShowImage) Path() string

type SubData

type SubData struct {
	Name string `json:"name"`
}

type UpdateByID

type UpdateByID struct {
	httpx.MethodPut
	Data Data `in:"body"`
}

update by id

func (UpdateByID) Output

func (req UpdateByID) Output(ctx context.Context) (interface{}, error)

Jump to

Keyboard shortcuts

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