demo

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindingRenderRoutes

func BindingRenderRoutes(srv BindingRender) []gors.Route

func BytesBytesRoutes

func BytesBytesRoutes(srv BytesBytes) []gors.Route

func BytesReaderRoutes

func BytesReaderRoutes(srv BytesReader) []gors.Route

func BytesStringRoutes

func BytesStringRoutes(srv BytesString) []gors.Route

func ReaderBytesRoutes

func ReaderBytesRoutes(srv ReaderBytes) []gors.Route

func ReaderReaderRoutes

func ReaderReaderRoutes(srv ReaderReader) []gors.Route

func ReaderStringRoutes

func ReaderStringRoutes(srv ReaderString) []gors.Route

func ServiceRoutes

func ServiceRoutes(srv Service) []gors.Route

func StringBytesRoutes

func StringBytesRoutes(srv StringBytes) []gors.Route

func StringReaderRoutes

func StringReaderRoutes(srv StringReader) []gors.Route

func StringStringRoutes

func StringStringRoutes(srv StringString) []gors.Route

Types

type AsciiJSONRenderResp

type AsciiJSONRenderResp struct {
	ID         int64     `json:"id"`
	Name       string    `json:"name"`
	Auth       string    `json:"auth"`
	Address    string    `json:"address"`
	Birthday   time.Time `json:"birthday"`
	CreateTime time.Time `json:"createTime"`
	UnixTime   time.Time `json:"unixTime"`
}

type BindingRender

type BindingRender interface {
	// UriBindingIndentedJSONRender
	// @GORS @GET @Path("/UriBindingIndentedJSONRender/:id") @UriBinding @IndentedJSONRender
	UriBindingIndentedJSONRender(context.Context, *UriBindingReq) (*IndentedJSONRenderResp, error)
	// QueryBindingSecureJSONRender
	// @GORS @GET @Path("/QueryBindingSecureJSONRender/:id") @UriBinding @QueryBinding @SecureJSONRender
	QueryBindingSecureJSONRender(context.Context, *QueryBindingReq) (*SecureJSONRenderResp, error)
	// HeaderBindingJsonpJSONRender
	// @GORS @GET @Path("/HeaderBindingJsonpJSONRender/:id") @UriBinding @QueryBinding @HeaderBinding @JsonpJSONRender
	HeaderBindingJsonpJSONRender(context.Context, *HeaderBindingReq) (*JsonpJSONRenderResp, error)
	// JSONBindingJSONRender
	// @GORS @POST @Path("/JSONBindingJSONRender/:id") @UriBinding @QueryBinding @HeaderBinding @JSONBinding @JSONRender
	JSONBindingJSONRender(context.Context, *JSONBindingReq) (*JSONRenderResp, error)
	// XMLBindingXMLRender
	// @GORS @PATCH @Path("/XMLBindingXMLRender/:id") @UriBinding @QueryBinding @HeaderBinding  @XMLBinding @XMLRender
	XMLBindingXMLRender(context.Context, *XMLBindingReq) (*XMLRenderResp, error)
	// FormBindingJSONRender
	// @GORS @POST @Path("/FormBindingJSONRender/:id") @UriBinding @HeaderBinding @FormBinding @JSONRender
	FormBindingJSONRender(context.Context, *FormBindingReq) (*JSONRenderResp, error)
	// FormPostBindingPureJSONRender
	// @GORS @POST @Path("/FormPostBindingPureJSONRender/:id") @UriBinding @QueryBinding @HeaderBinding @FormPostBinding @PureJSONRender
	FormPostBindingPureJSONRender(context.Context, *FormPostBindingReq) (*PureJSONRenderResp, error)
	// FormMultipartBindingAsciiJSONRender
	// @GORS @POST @Path("/FormMultipartBindingAsciiJSONRender/:id") @UriBinding @QueryBinding @HeaderBinding @FormMultipartBinding @AsciiJSONRender
	FormMultipartBindingAsciiJSONRender(context.Context, *FormMultipartBindingReq) (*AsciiJSONRenderResp, error)
	// ProtoBufBindingProtoBufRender
	// @GORS @PUT @Path("/ProtoBufBindingProtoBufRender") @ProtoBufBinding @ProtoBufRender
	ProtoBufBindingProtoBufRender(context.Context, *pb.ProtoBufReq) (*pb.ProtoBufResp, error)
	// MsgPackBindingMsgPackRender
	// @GORS @DELETE @Path("/MsgPackBindingMsgPackRender") @MsgPackBinding @MsgPackRender
	MsgPackBindingMsgPackRender(context.Context, *MsgPackBindingReq) (*MsgPackRenderResp, error)
	// YAMLBindingYAMLRender
	// @GORS @DELETE @Path("/YAMLBindingYAMLRender/:id") @UriBinding @QueryBinding @HeaderBinding @YAMLBinding @YAMLRender
	YAMLBindingYAMLRender(context.Context, *YAMLBindingReq) (*YAMLRenderResp, error)
	// TOMLBindingTOMLRender
	// @GORS @PUT @Path("/TOMLBindingTOMLRender/:id") @UriBinding @QueryBinding @HeaderBinding @TOMLBinding @TOMLRender
	TOMLBindingTOMLRender(context.Context, *TOMLBindingReq) (*TOMLRenderResp, error)
}

BindingRender @GORS @Path("/api") @Path("/BindingRender")

type BytesBytes

type BytesBytes interface {
	// GetBytesBytes
	// @GORS @GET @Path("/Get") @BytesRender("text/go")
	GetBytesBytes(context.Context, []byte) ([]byte, error)
	// PostBytesBytes
	// @GORS @POST @Path("/Post") @BytesRender("text/go")
	PostBytesBytes(context.Context, []byte) ([]byte, error)
}

BytesBytes @GORS @Path("/api") @Path("/BytesBytes")

type BytesReader

type BytesReader interface {
	// GetBytesReader
	// @GORS @GET @Path("/Get") @ReaderRender("video/mpeg4")
	GetBytesReader(context.Context, []byte) (tmpio.Reader, error)
	// PatchBytesReader
	// @GORS @PATCH @Path("/Patch") @ReaderRender("video/mpeg4")
	PatchBytesReader(context.Context, []byte) (tmpio.Reader, error)
}

BytesReader @GORS @Path("/api") @Path("/BytesReader")

type BytesString

type BytesString interface {
	// GetBytesString
	// @GORS @GET @Path("/Get") @HTMLRender
	GetBytesString(context.Context, []byte) (string, error)
	// PutBytesString
	// @GORS @PUT @Path("/Put") @RedirectRender
	PutBytesString(context.Context, []byte) (string, error)
}

BytesString @GORS @Path("/api") @Path("/BytesString")

type FormBindingReq

type FormBindingReq struct {
	ID      int64                 `uri:"id"`
	Name    string                `form:"name"`
	Auth    string                `header:"Authorization"`
	Address string                `form:"address"`
	Avatar  *multipart.FileHeader `form:"avatar"`
}

type FormBindingResp

type FormBindingResp struct {
	V int64
}

type FormMultipartBindingReq

type FormMultipartBindingReq struct {
	ID      int64                 `uri:"id"`
	Name    string                `form:"name"`
	Auth    string                `header:"Authorization"`
	Address string                `form:"address"`
	Avatar  *multipart.FileHeader `form:"avatar"`
}

type FormPostBindingReq

type FormPostBindingReq struct {
	ID      int64  `uri:"id"`
	Name    string `form:"name"`
	Auth    string `header:"Authorization"`
	Address string `form:"address"`
}

type HeaderBindingReq

type HeaderBindingReq struct {
	ID   int64  `uri:"id"`
	Name string `form:"name"`
	Auth string `header:"Authorization"`
}

type IndentedJSONRenderResp

type IndentedJSONRenderResp struct {
	ID         int64     `json:"id"`
	Name       string    `json:"name"`
	Address    string    `json:"address"`
	Birthday   time.Time `json:"birthday"`
	CreateTime time.Time `json:"createTime"`
	UnixTime   time.Time `json:"unixTime"`
}

type JSONBindingReq

type JSONBindingReq struct {
	ID      int64  `uri:"id"`
	Name    string `form:"name"`
	Auth    string `header:"Authorization"`
	Address string `json:"address"`
}

type JSONRenderResp

type JSONRenderResp struct {
	ID         int64     `json:"id"`
	Name       string    `json:"name"`
	Auth       string    `json:"auth"`
	Address    string    `json:"address"`
	Birthday   time.Time `json:"birthday"`
	CreateTime time.Time `json:"createTime"`
	UnixTime   time.Time `json:"unixTime"`
}

type JsonpJSONRenderResp

type JsonpJSONRenderResp struct {
	ID         int64     `json:"id"`
	Name       string    `json:"name"`
	Auth       string    `json:"auth"`
	Address    string    `json:"address"`
	Birthday   time.Time `json:"birthday"`
	CreateTime time.Time `json:"createTime"`
	UnixTime   time.Time `json:"unixTime"`
}

type MethodReq

type MethodReq struct {
	ID int `uri:"id"`
}

type MethodResp

type MethodResp struct {
	V int `json:"v,omitempty"`
}

type MsgPackBindingReq

type MsgPackBindingReq struct {
	ID      int64  `uri:"id"`
	Name    string `form:"name"`
	Auth    string `header:"Authorization"`
	Address string
}

type MsgPackRenderResp

type MsgPackRenderResp struct {
	ID         int64
	Name       string
	Auth       string
	Address    string
	Birthday   time.Time
	CreateTime time.Time
	UnixTime   time.Time
}

type PureJSONRenderResp

type PureJSONRenderResp struct {
	ID         int64     `json:"id"`
	Name       string    `json:"name"`
	Auth       string    `json:"auth"`
	Address    string    `json:"address"`
	Birthday   time.Time `json:"birthday"`
	CreateTime time.Time `json:"createTime"`
	UnixTime   time.Time `json:"unixTime"`
}

type QueryBindingReq

type QueryBindingReq struct {
	ID   int64  `uri:"id"`
	Name string `form:"name"`
}

type ReaderBytes

type ReaderBytes interface {
	// GetReaderBytes
	// @GORS @GET @Path("/Get") @BytesRender
	GetReaderBytes(context.Context, tmpio.Reader) ([]byte, error)
	// PostReaderBytes
	// @GORS @POST @Path("/Post") @BytesRender("text/go")
	PostReaderBytes(context.Context, tmpio.Reader) ([]byte, error)
}

ReaderBytes @GORS @Path("/api") @Path("/ReaderBytes")

type ReaderReader

type ReaderReader interface {
	// GetReaderReader
	// @GORS @GET @Path("/Get") @ReaderRender
	GetReaderReader(context.Context, io.Reader) (io.Reader, error)
	// HeadReaderReader
	// @GORS @HEAD @Path("/head") @ReaderRender
	HeadReaderReader(context.Context, io.Reader) (io.Reader, error)
}

ReaderReader @GORS @Path("/api") @Path("/ReaderReader")

type ReaderString

type ReaderString interface {
	// GetReaderString
	// @GORS @GET @Path("/Get") @TextRender
	GetReaderString(context.Context, io.Reader) (string, error)
	// PostReaderString
	// @GORS @POST @Path("/Post") @StringRender("text/go")
	PostReaderString(context.Context, io.Reader) (string, error)
}

ReaderString @GORS @Path("/api") @Path("/ReaderString")

type SecureJSONRenderResp

type SecureJSONRenderResp struct {
	ID         int64     `json:"id"`
	Name       string    `json:"name"`
	Address    string    `json:"address"`
	Birthday   time.Time `json:"birthday"`
	CreateTime time.Time `json:"createTime"`
	UnixTime   time.Time `json:"unixTime"`
}

type Service

type Service interface {
	// Method
	// @GORS @GET @Path("/method/:id") @UriBinding @JSONRender
	Method(context.Context, *MethodReq) (*MethodResp, error)
}

Service @GORS @Path("/api") @Path("/v1")

type StringBytes

type StringBytes interface {
	// GetStringBytes
	// @GORS @GET @Path("/Get") @BytesRender
	GetStringBytes(context.Context, string) ([]byte, error)
	// OptionsStringBytes
	// @GORS @OPTIONS @Path("/Options") @BytesRender
	OptionsStringBytes(context.Context, string) ([]byte, error)
}

StringBytes @GORS @Path("/api") @Path("/StringBytes")

type StringReader

type StringReader interface {
	// GetStringRender
	// @GORS @GET @Path("/Get") @ReaderRender("video/mpeg4")
	GetStringRender(context.Context, string) (tmpio.Reader, error)
	// OptionsStringReader
	// @GORS @OPTIONS @Path("/Options") @ReaderRender("video/mpeg4")
	OptionsStringReader(context.Context, string) (tmpio.Reader, error)
}

StringReader @GORS @Path("/api") @Path("/StringReader")

type StringString

type StringString interface {
	// GetStringString
	// @GORS @GET @Path("/Get") @StringRender("text/go")
	GetStringString(context.Context, string) (string, error)
	// PatchStringString
	// @GORS @PATCH @Path("/Patch") @StringRender("text/go")
	PatchStringString(context.Context, string) (string, error)
}

StringString @GORS @Path("/api") @Path("/StringString")

type TOMLBindingReq

type TOMLBindingReq struct {
	ID      int64  `uri:"id"`
	Name    string `form:"name"`
	Auth    string `header:"Authorization"`
	Address string `toml:"address"`
}

type TOMLRenderResp

type TOMLRenderResp struct {
	ID         int64     `toml:"id"`
	Name       string    `toml:"name"`
	Auth       string    `toml:"auth"`
	Address    string    `toml:"address"`
	Birthday   time.Time `toml:"birthday"`
	CreateTime time.Time `toml:"createTime"`
	UnixTime   time.Time `toml:"unixTime"`
}

type UriBindingReq

type UriBindingReq struct {
	ID int64 `uri:"id"`
}

type XMLBindingReq

type XMLBindingReq struct {
	ID      int64  `uri:"id"`
	Name    string `form:"name"`
	Auth    string `header:"Authorization"`
	Address string `xml:"address"`
}

type XMLRenderResp

type XMLRenderResp struct {
	ID         int64     `xml:"id"`
	Name       string    `xml:"name"`
	Auth       string    `xml:"auth"`
	Address    string    `xml:"address"`
	Birthday   time.Time `xml:"birthday"`
	CreateTime time.Time `xml:"createTime"`
	UnixTime   time.Time `xml:"unixTime"`
}

type YAMLBindingReq

type YAMLBindingReq struct {
	ID      int64  `uri:"id"`
	Name    string `form:"name"`
	Auth    string `header:"Authorization"`
	Address string `yaml:"address"`
}

type YAMLRenderResp

type YAMLRenderResp struct {
	ID         int64     `yaml:"id"`
	Name       string    `yaml:"name"`
	Auth       string    `yaml:"auth"`
	Address    string    `yaml:"address"`
	Birthday   time.Time `yaml:"birthday"`
	CreateTime time.Time `yaml:"createTime"`
	UnixTime   time.Time `yaml:"unixTime"`
}

Jump to

Keyboard shortcuts

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