Documentation ¶
Index ¶
- Variables
- func New(method, path string, options ...Option) *swag.Endpoint
- type Option
- func Body(prototype interface{}, description string, required bool) Option
- func BodyR(prototype interface{}) Option
- func Consumes(v ...string) Option
- func Deprecated() Option
- func Description(v string) Option
- func FormData(name string, typ types.ParameterType, description string, required bool) Option
- func Handler(handler interface{}) Option
- func NoSecurity() Option
- func OperationID(v string) Option
- func Path(name string, typ types.ParameterType, description string, required bool) Option
- func PathDefault(name string, typ types.ParameterType, description, defVal string, ...) Option
- func PathS(name, description string) Option
- func PathString(name, description string) Option
- func Produces(v ...string) Option
- func Query(name string, typ types.ParameterType, description string, required bool) Option
- func QueryDefault(name string, typ types.ParameterType, description, defVal string, ...) Option
- func QueryS(name, description string) Option
- func QueryString(name, description string) Option
- func Response(code int, description string, opts ...ResponseOption) Option
- func ResponseSuccess(opts ...ResponseOption) Option
- func Security(scheme string, scopes ...string) Option
- func Summary(v string) Option
- func Tags(tags ...string) Option
- type ResponseOption
Constants ¶
This section is empty.
Variables ¶
var Schema = SchemaResponseOption
Schema is the same as SchemaResponseOption. Deprecated.
Functions ¶
Types ¶
type Option ¶
Option represents a functional option to customize the swagger endpoint
func Body ¶
Body defines a body parameter for the swagger endpoint as would commonly be used for the POST, PUT, and PATCH methods prototype should be a struct or a pointer to struct that swag can use to reflect upon the return type
func BodyR ¶
func BodyR(prototype interface{}) Option
BodyR defines a body parameter for the swagger endpoint as would commonly be used for the POST, PUT, and PATCH methods prototype should be a struct or a pointer to struct that swag can use to reflect upon the return type
func Consumes ¶
Consumes sets the endpoint's produces; by default this will be set to application/json
func Deprecated ¶
func Deprecated() Option
func FormData ¶
FormData defines a form-data parameter for the endpoint; name, typ, description and required correspond to the matching swagger fields
func Handler ¶
func Handler(handler interface{}) Option
Handler allows an instance of the web handler to be associated with the endpoint. This can be especially useful when using swag to bind the endpoints to the web router. See the examples package for how the Handler can be used in conjunction with Walk to simplify binding endpoints to a router
func NoSecurity ¶
func NoSecurity() Option
NoSecurity explicitly sets the endpoint to have no security requirements.
func Path ¶
Path defines a path parameter for the endpoint; name, typ, description and required correspond to the matching swagger fields
func PathDefault ¶
func PathDefault(name string, typ types.ParameterType, description, defVal string, required bool) Option
PathDefault defines a path parameter for the endpoint; name, typ, description, defVal and required correspond to the matching swagger fields
func PathS ¶
PathS defines a path parameter for the endpoint; name and description correspond to the matching swagger fields, type defaults to string, required defaults to true.
func PathString ¶
PathString is the same as PathS. Deprecated.
func Produces ¶
Produces sets the endpoint's produces; by default this will be set to application/json
func Query ¶
Query defines a query parameter for the endpoint; name, typ, description and required correspond to the matching swagger fields
func QueryDefault ¶
func QueryDefault(name string, typ types.ParameterType, description, defVal string, required bool) Option
QueryDefault defines a query parameter for the endpoint; name, typ, description, defVal and required correspond to the matching swagger fields
func QueryS ¶
QueryS defines a query parameter for the endpoint; name and description correspond to the matching swagger fields, type defaults to string, required defaults to false.
func QueryString ¶
QueryString is the same as QueryS. Deprecated.
func Response ¶
func Response(code int, description string, opts ...ResponseOption) Option
Response sets the endpoint response for the specified code; may be used multiple times with different status codes
func ResponseSuccess ¶
func ResponseSuccess(opts ...ResponseOption) Option
type ResponseOption ¶
ResponseOption allows for additional configurations on responses like header information
func HeaderResponseOption ¶
func HeaderResponseOption(name string, typ types.ParameterType, format, description string) ResponseOption
HeaderResponseOption adds header definitions to swagger responses
func HeaderSResponseOption ¶
func HeaderSResponseOption(name, description string) ResponseOption
HeaderSResponseOption adds the string type header definitions to swagger responses
func SchemaResponseOption ¶
func SchemaResponseOption(schema interface{}) ResponseOption
SchemaResponseOption adds schema definitions to swagger responses