Documentation ¶
Index ¶
- type PlantbookAPI
- func (o *PlantbookAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
- func (o *PlantbookAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *PlantbookAPI) Authorizer() runtime.Authorizer
- func (o *PlantbookAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *PlantbookAPI) Context() *middleware.Context
- func (o *PlantbookAPI) DefaultConsumes() string
- func (o *PlantbookAPI) DefaultProduces() string
- func (o *PlantbookAPI) Formats() strfmt.Registry
- func (o *PlantbookAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *PlantbookAPI) Init()
- func (o *PlantbookAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *PlantbookAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *PlantbookAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *PlantbookAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *PlantbookAPI) Serve(builder middleware.Builder) http.Handler
- func (o *PlantbookAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *PlantbookAPI) SetDefaultConsumes(mediaType string)
- func (o *PlantbookAPI) SetDefaultProduces(mediaType string)
- func (o *PlantbookAPI) SetSpec(spec *loads.Document)
- func (o *PlantbookAPI) UseRedoc()
- func (o *PlantbookAPI) UseSwaggerUI()
- func (o *PlantbookAPI) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PlantbookAPI ¶
type PlantbookAPI 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 // TxtProducer registers a producer for the following mime types: // - text/plain TxtProducer runtime.Producer // HealthGetMetricsHandler sets the operation handler for the get metrics operation HealthGetMetricsHandler health.GetMetricsHandler // HealthAPIVersionHandler sets the operation handler for the api version operation HealthAPIVersionHandler health.APIVersionHandler // UserCreateUserHandler sets the operation handler for the create user operation UserCreateUserHandler user.CreateUserHandler // GardensCreateUserGardenHandler sets the operation handler for the create user garden operation GardensCreateUserGardenHandler gardens.CreateUserGardenHandler // UserplantCreateUserPlantHandler sets the operation handler for the create user plant operation UserplantCreateUserPlantHandler userplant.CreateUserPlantHandler // UserDeleteUserHandler sets the operation handler for the delete user operation UserDeleteUserHandler user.DeleteUserHandler // GardensDeleteUserGardenHandler sets the operation handler for the delete user garden operation GardensDeleteUserGardenHandler gardens.DeleteUserGardenHandler // UserplantDeleteUserPlantHandler sets the operation handler for the delete user plant operation UserplantDeleteUserPlantHandler userplant.DeleteUserPlantHandler // RefplantGetRefPlantByIDHandler sets the operation handler for the get ref plant by Id operation RefplantGetRefPlantByIDHandler refplant.GetRefPlantByIDHandler // RefplantGetRefPlantsHandler sets the operation handler for the get ref plants operation RefplantGetRefPlantsHandler refplant.GetRefPlantsHandler // UserGetUserByNameHandler sets the operation handler for the get user by name operation UserGetUserByNameHandler user.GetUserByNameHandler // GardensGetUserGardenByIDHandler sets the operation handler for the get user garden by ID operation GardensGetUserGardenByIDHandler gardens.GetUserGardenByIDHandler // GardensGetUserGardensHandler sets the operation handler for the get user gardens operation GardensGetUserGardensHandler gardens.GetUserGardensHandler // UserplantGetUserPlantByIDHandler sets the operation handler for the get user plant by ID operation UserplantGetUserPlantByIDHandler userplant.GetUserPlantByIDHandler // UserplantGetUserPlantsHandler sets the operation handler for the get user plants operation UserplantGetUserPlantsHandler userplant.GetUserPlantsHandler // HealthHealthAliveHandler sets the operation handler for the health alive operation HealthHealthAliveHandler health.HealthAliveHandler // HealthHealthReadyHandler sets the operation handler for the health ready operation HealthHealthReadyHandler health.HealthReadyHandler // UserLoginUserHandler sets the operation handler for the login user operation UserLoginUserHandler user.LoginUserHandler // UserLogoutUserHandler sets the operation handler for the logout user operation UserLogoutUserHandler user.LogoutUserHandler // UserUpdateUserHandler sets the operation handler for the update user operation UserUpdateUserHandler user.UpdateUserHandler // UserplantUpdateUserPlantHandler sets the operation handler for the update user plant operation UserplantUpdateUserPlantHandler userplant.UpdateUserPlantHandler // 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 }
PlantbookAPI This is a Plantbook project API description. You can find out more about us at [https://github.com/kaatinga/plantbook](https://github.com/kaatinga/plantbook).
func NewPlantbookAPI ¶
func NewPlantbookAPI(spec *loads.Document) *PlantbookAPI
NewPlantbookAPI creates a new Plantbook instance
func (*PlantbookAPI) AddMiddlewareFor ¶
func (o *PlantbookAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
AddMiddlewareFor adds a http middleware to existing handler
func (*PlantbookAPI) AuthenticatorsFor ¶
func (o *PlantbookAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*PlantbookAPI) Authorizer ¶
func (o *PlantbookAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*PlantbookAPI) ConsumersFor ¶
func (o *PlantbookAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
ConsumersFor gets the consumers for the specified media types. MIME type parameters are ignored here.
func (*PlantbookAPI) Context ¶
func (o *PlantbookAPI) Context() *middleware.Context
Context returns the middleware context for the plantbook API
func (*PlantbookAPI) DefaultConsumes ¶
func (o *PlantbookAPI) DefaultConsumes() string
DefaultConsumes returns the default consumes media type
func (*PlantbookAPI) DefaultProduces ¶
func (o *PlantbookAPI) DefaultProduces() string
DefaultProduces returns the default produces media type
func (*PlantbookAPI) Formats ¶
func (o *PlantbookAPI) Formats() strfmt.Registry
Formats returns the registered string formats
func (*PlantbookAPI) HandlerFor ¶
func (o *PlantbookAPI) HandlerFor(method, path string) (http.Handler, bool)
HandlerFor gets a http.Handler for the provided operation method and path
func (*PlantbookAPI) Init ¶
func (o *PlantbookAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*PlantbookAPI) ProducersFor ¶
func (o *PlantbookAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
ProducersFor gets the producers for the specified media types. MIME type parameters are ignored here.
func (*PlantbookAPI) RegisterConsumer ¶
func (o *PlantbookAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*PlantbookAPI) RegisterFormat ¶
func (o *PlantbookAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
RegisterFormat registers a custom format validator
func (*PlantbookAPI) RegisterProducer ¶
func (o *PlantbookAPI) RegisterProducer(mediaType string, producer runtime.Producer)
RegisterProducer allows you to add (or override) a producer for a media type.
func (*PlantbookAPI) Serve ¶
func (o *PlantbookAPI) 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 (*PlantbookAPI) ServeErrorFor ¶
func (o *PlantbookAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*PlantbookAPI) SetDefaultConsumes ¶
func (o *PlantbookAPI) SetDefaultConsumes(mediaType string)
SetDefaultConsumes returns the default consumes media type
func (*PlantbookAPI) SetDefaultProduces ¶
func (o *PlantbookAPI) SetDefaultProduces(mediaType string)
SetDefaultProduces sets the default produces media type
func (*PlantbookAPI) SetSpec ¶
func (o *PlantbookAPI) SetSpec(spec *loads.Document)
SetSpec sets a spec that will be served for the clients.
func (*PlantbookAPI) UseRedoc ¶
func (o *PlantbookAPI) UseRedoc()
UseRedoc for documentation at /docs
func (*PlantbookAPI) UseSwaggerUI ¶
func (o *PlantbookAPI) UseSwaggerUI()
UseSwaggerUI for documentation at /docs
func (*PlantbookAPI) Validate ¶
func (o *PlantbookAPI) Validate() error
Validate validates the registrations in the PlantbookAPI