Documentation ¶
Index ¶
- Constants
- type Chess2picAPIAPI
- func (o *Chess2picAPIAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
- func (o *Chess2picAPIAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *Chess2picAPIAPI) Authorizer() runtime.Authorizer
- func (o *Chess2picAPIAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *Chess2picAPIAPI) Context() *middleware.Context
- func (o *Chess2picAPIAPI) DefaultConsumes() string
- func (o *Chess2picAPIAPI) DefaultProduces() string
- func (o *Chess2picAPIAPI) Formats() strfmt.Registry
- func (o *Chess2picAPIAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *Chess2picAPIAPI) Init()
- func (o *Chess2picAPIAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *Chess2picAPIAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *Chess2picAPIAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *Chess2picAPIAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *Chess2picAPIAPI) Serve(builder middleware.Builder) http.Handler
- func (o *Chess2picAPIAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *Chess2picAPIAPI) SetDefaultConsumes(mediaType string)
- func (o *Chess2picAPIAPI) SetDefaultProduces(mediaType string)
- func (o *Chess2picAPIAPI) SetSpec(spec *loads.Document)
- func (o *Chess2picAPIAPI) UseRedoc()
- func (o *Chess2picAPIAPI) UseSwaggerUI()
- func (o *Chess2picAPIAPI) Validate() error
- type PostFen
- type PostFenBody
- type PostFenHandler
- type PostFenHandlerFunc
- type PostFenOK
- type PostFenParams
- type PostFenURL
- func (o *PostFenURL) Build() (*url.URL, error)
- func (o *PostFenURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *PostFenURL) Must(u *url.URL, err error) *url.URL
- func (o *PostFenURL) SetBasePath(bp string)
- func (o *PostFenURL) String() string
- func (o *PostFenURL) StringFull(scheme, host string) string
- func (o *PostFenURL) WithBasePath(bp string) *PostFenURL
- type PostPgn
- type PostPgnBody
- type PostPgnHandler
- type PostPgnHandlerFunc
- type PostPgnOK
- type PostPgnParams
- type PostPgnURL
- func (o *PostPgnURL) Build() (*url.URL, error)
- func (o *PostPgnURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *PostPgnURL) Must(u *url.URL, err error) *url.URL
- func (o *PostPgnURL) SetBasePath(bp string)
- func (o *PostPgnURL) String() string
- func (o *PostPgnURL) StringFull(scheme, host string) string
- func (o *PostPgnURL) WithBasePath(bp string) *PostPgnURL
Constants ¶
const PostFenOKCode int = 200
PostFenOKCode is the HTTP code returned for type PostFenOK
const PostPgnOKCode int = 200
PostPgnOKCode is the HTTP code returned for type PostPgnOK
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chess2picAPIAPI ¶
type Chess2picAPIAPI struct { Middleware func(middleware.Builder) http.Handler // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. // It has a default implementation in the security package, however you can replace it for your particular usage. BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. // It has a default implementation in the security package, however you can replace it for your particular usage. APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. // It has a default implementation in the security package, however you can replace it for your particular usage. BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator // JSONConsumer registers a consumer for the following mime types: // - application/json JSONConsumer runtime.Consumer // JSONProducer registers a producer for the following mime types: // - application/json JSONProducer runtime.Producer // PostFenHandler sets the operation handler for the post fen operation PostFenHandler PostFenHandler // PostPgnHandler sets the operation handler for the post pgn operation PostPgnHandler PostPgnHandler // ServeError is called when an error is received, there is a default handler // but you can set your own with this ServeError func(http.ResponseWriter, *http.Request, error) // PreServerShutdown is called before the HTTP(S) server is shutdown // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic PreServerShutdown func() // ServerShutdown is called when the HTTP(S) server is shut down and done // handling all active connections and does not accept connections any more ServerShutdown func() // Custom command line argument groups with their descriptions CommandLineOptionsGroups []swag.CommandLineOptionsGroup // User defined logger function. Logger func(string, ...interface{}) // contains filtered or unexported fields }
Chess2picAPIAPI chess2pic REST API server
func NewChess2picAPIAPI ¶
func NewChess2picAPIAPI(spec *loads.Document) *Chess2picAPIAPI
NewChess2picAPIAPI creates a new Chess2picAPI instance
func (*Chess2picAPIAPI) AddMiddlewareFor ¶
func (o *Chess2picAPIAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
AddMiddlewareFor adds a http middleware to existing handler
func (*Chess2picAPIAPI) AuthenticatorsFor ¶
func (o *Chess2picAPIAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*Chess2picAPIAPI) Authorizer ¶
func (o *Chess2picAPIAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*Chess2picAPIAPI) ConsumersFor ¶
func (o *Chess2picAPIAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
ConsumersFor gets the consumers for the specified media types. MIME type parameters are ignored here.
func (*Chess2picAPIAPI) Context ¶
func (o *Chess2picAPIAPI) Context() *middleware.Context
Context returns the middleware context for the chess2pic API API
func (*Chess2picAPIAPI) DefaultConsumes ¶
func (o *Chess2picAPIAPI) DefaultConsumes() string
DefaultConsumes returns the default consumes media type
func (*Chess2picAPIAPI) DefaultProduces ¶
func (o *Chess2picAPIAPI) DefaultProduces() string
DefaultProduces returns the default produces media type
func (*Chess2picAPIAPI) Formats ¶
func (o *Chess2picAPIAPI) Formats() strfmt.Registry
Formats returns the registered string formats
func (*Chess2picAPIAPI) HandlerFor ¶
func (o *Chess2picAPIAPI) HandlerFor(method, path string) (http.Handler, bool)
HandlerFor gets a http.Handler for the provided operation method and path
func (*Chess2picAPIAPI) Init ¶
func (o *Chess2picAPIAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*Chess2picAPIAPI) ProducersFor ¶
func (o *Chess2picAPIAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
ProducersFor gets the producers for the specified media types. MIME type parameters are ignored here.
func (*Chess2picAPIAPI) RegisterConsumer ¶
func (o *Chess2picAPIAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*Chess2picAPIAPI) RegisterFormat ¶
func (o *Chess2picAPIAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
RegisterFormat registers a custom format validator
func (*Chess2picAPIAPI) RegisterProducer ¶
func (o *Chess2picAPIAPI) RegisterProducer(mediaType string, producer runtime.Producer)
RegisterProducer allows you to add (or override) a producer for a media type.
func (*Chess2picAPIAPI) Serve ¶
func (o *Chess2picAPIAPI) Serve(builder middleware.Builder) http.Handler
Serve creates a http handler to serve the API over HTTP can be used directly in http.ListenAndServe(":8000", api.Serve(nil))
func (*Chess2picAPIAPI) ServeErrorFor ¶
func (o *Chess2picAPIAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*Chess2picAPIAPI) SetDefaultConsumes ¶
func (o *Chess2picAPIAPI) SetDefaultConsumes(mediaType string)
SetDefaultConsumes returns the default consumes media type
func (*Chess2picAPIAPI) SetDefaultProduces ¶
func (o *Chess2picAPIAPI) SetDefaultProduces(mediaType string)
SetDefaultProduces sets the default produces media type
func (*Chess2picAPIAPI) SetSpec ¶
func (o *Chess2picAPIAPI) SetSpec(spec *loads.Document)
SetSpec sets a spec that will be served for the clients.
func (*Chess2picAPIAPI) UseRedoc ¶
func (o *Chess2picAPIAPI) UseRedoc()
UseRedoc for documentation at /docs
func (*Chess2picAPIAPI) UseSwaggerUI ¶
func (o *Chess2picAPIAPI) UseSwaggerUI()
UseSwaggerUI for documentation at /docs
func (*Chess2picAPIAPI) Validate ¶
func (o *Chess2picAPIAPI) Validate() error
Validate validates the registrations in the Chess2picAPIAPI
type PostFen ¶
type PostFen struct { Context *middleware.Context Handler PostFenHandler }
PostFen swagger:route POST /fen postFen
Convert FEN position to PNG image
func NewPostFen ¶
func NewPostFen(ctx *middleware.Context, handler PostFenHandler) *PostFen
NewPostFen creates a new http.Handler for the post fen operation
type PostFenBody ¶
type PostFenBody struct { // visualize form white's persective // Required: true FromWhite *bool `json:"from-white"` // Chess position in FEN notation // Required: true Notation *string `json:"notation"` }
PostFenBody post fen body Example: {"from-white":true,"notation":"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR"}
swagger:model PostFenBody
func (*PostFenBody) ContextValidate ¶
ContextValidate validates this post fen body based on context it is used
func (*PostFenBody) MarshalBinary ¶
func (o *PostFenBody) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*PostFenBody) UnmarshalBinary ¶
func (o *PostFenBody) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
type PostFenHandler ¶
type PostFenHandler interface {
Handle(PostFenParams) middleware.Responder
}
PostFenHandler interface for that can handle valid post fen params
type PostFenHandlerFunc ¶
type PostFenHandlerFunc func(PostFenParams) middleware.Responder
PostFenHandlerFunc turns a function with the right signature into a post fen handler
func (PostFenHandlerFunc) Handle ¶
func (fn PostFenHandlerFunc) Handle(params PostFenParams) middleware.Responder
Handle executing the request and returning a response
type PostFenOK ¶
PostFenOK API call result
swagger:response postFenOK
func NewPostFenOK ¶
func NewPostFenOK() *PostFenOK
NewPostFenOK creates PostFenOK with default headers values
func (*PostFenOK) SetPayload ¶
SetPayload sets the payload to the post fen o k response
func (*PostFenOK) WithPayload ¶
WithPayload adds the payload to the post fen o k response
func (*PostFenOK) WriteResponse ¶
func (o *PostFenOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type PostFenParams ¶
type PostFenParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /*FEN visualization request Required: true In: body */ Body PostFenBody }
PostFenParams contains all the bound params for the post fen operation typically these are obtained from a http.Request
swagger:parameters PostFen
func NewPostFenParams ¶
func NewPostFenParams() PostFenParams
NewPostFenParams creates a new PostFenParams object
There are no default values defined in the spec.
func (*PostFenParams) BindRequest ¶
func (o *PostFenParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error
BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls.
To ensure default values, the struct must have been initialized with NewPostFenParams() beforehand.
type PostFenURL ¶
type PostFenURL struct {
// contains filtered or unexported fields
}
PostFenURL generates an URL for the post fen operation
func (*PostFenURL) Build ¶
func (o *PostFenURL) Build() (*url.URL, error)
Build a url path and query string
func (*PostFenURL) BuildFull ¶
func (o *PostFenURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*PostFenURL) SetBasePath ¶
func (o *PostFenURL) SetBasePath(bp string)
SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string
func (*PostFenURL) String ¶
func (o *PostFenURL) String() string
String returns the string representation of the path with query string
func (*PostFenURL) StringFull ¶
func (o *PostFenURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*PostFenURL) WithBasePath ¶
func (o *PostFenURL) WithBasePath(bp string) *PostFenURL
WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string
type PostPgn ¶
type PostPgn struct { Context *middleware.Context Handler PostPgnHandler }
PostPgn swagger:route POST /pgn postPgn
Convert PGN game to GIF animation
func NewPostPgn ¶
func NewPostPgn(ctx *middleware.Context, handler PostPgnHandler) *PostPgn
NewPostPgn creates a new http.Handler for the post pgn operation
type PostPgnBody ¶
type PostPgnBody struct { // visualize form white's persective // Required: true FromWhite *bool `json:"from-white"` // Chess game in PGN notation // Required: true Notation *string `json:"notation"` }
PostPgnBody post pgn body Example: {"from-white":true,"notation":"[FEN \"k7/1p6/8/8/8/8/6P1/7K w - - 0 1\"]\n\n1. g4 b5 2. g5 b4"}
swagger:model PostPgnBody
func (*PostPgnBody) ContextValidate ¶
ContextValidate validates this post pgn body based on context it is used
func (*PostPgnBody) MarshalBinary ¶
func (o *PostPgnBody) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*PostPgnBody) UnmarshalBinary ¶
func (o *PostPgnBody) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
type PostPgnHandler ¶
type PostPgnHandler interface {
Handle(PostPgnParams) middleware.Responder
}
PostPgnHandler interface for that can handle valid post pgn params
type PostPgnHandlerFunc ¶
type PostPgnHandlerFunc func(PostPgnParams) middleware.Responder
PostPgnHandlerFunc turns a function with the right signature into a post pgn handler
func (PostPgnHandlerFunc) Handle ¶
func (fn PostPgnHandlerFunc) Handle(params PostPgnParams) middleware.Responder
Handle executing the request and returning a response
type PostPgnOK ¶
PostPgnOK API call result
swagger:response postPgnOK
func NewPostPgnOK ¶
func NewPostPgnOK() *PostPgnOK
NewPostPgnOK creates PostPgnOK with default headers values
func (*PostPgnOK) SetPayload ¶
SetPayload sets the payload to the post pgn o k response
func (*PostPgnOK) WithPayload ¶
WithPayload adds the payload to the post pgn o k response
func (*PostPgnOK) WriteResponse ¶
func (o *PostPgnOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type PostPgnParams ¶
type PostPgnParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /*PGN visualization request Required: true In: body */ Body PostPgnBody }
PostPgnParams contains all the bound params for the post pgn operation typically these are obtained from a http.Request
swagger:parameters PostPgn
func NewPostPgnParams ¶
func NewPostPgnParams() PostPgnParams
NewPostPgnParams creates a new PostPgnParams object
There are no default values defined in the spec.
func (*PostPgnParams) BindRequest ¶
func (o *PostPgnParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error
BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls.
To ensure default values, the struct must have been initialized with NewPostPgnParams() beforehand.
type PostPgnURL ¶
type PostPgnURL struct {
// contains filtered or unexported fields
}
PostPgnURL generates an URL for the post pgn operation
func (*PostPgnURL) Build ¶
func (o *PostPgnURL) Build() (*url.URL, error)
Build a url path and query string
func (*PostPgnURL) BuildFull ¶
func (o *PostPgnURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*PostPgnURL) SetBasePath ¶
func (o *PostPgnURL) SetBasePath(bp string)
SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string
func (*PostPgnURL) String ¶
func (o *PostPgnURL) String() string
String returns the string representation of the path with query string
func (*PostPgnURL) StringFull ¶
func (o *PostPgnURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*PostPgnURL) WithBasePath ¶
func (o *PostPgnURL) WithBasePath(bp string) *PostPgnURL
WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string