Documentation
¶
Index ¶
- func LogOperation(tag, operationID string) func(http.Handler) http.Handler
- type RednerdAPI
- func (o *RednerdAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
- func (o *RednerdAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *RednerdAPI) Authorizer() runtime.Authorizer
- func (o *RednerdAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *RednerdAPI) Context() *middleware.Context
- func (o *RednerdAPI) DefaultConsumes() string
- func (o *RednerdAPI) DefaultProduces() string
- func (o *RednerdAPI) Formats() strfmt.Registry
- func (o *RednerdAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *RednerdAPI) Init()
- func (o *RednerdAPI) LoggingInstrumentHandlers()
- func (o *RednerdAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *RednerdAPI) PrometheusInstrumentHandlers()
- func (o *RednerdAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *RednerdAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *RednerdAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *RednerdAPI) Serve(builder middleware.Builder) http.Handler
- func (o *RednerdAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *RednerdAPI) SetDefaultConsumes(mediaType string)
- func (o *RednerdAPI) SetDefaultProduces(mediaType string)
- func (o *RednerdAPI) SetSpec(spec *loads.Document)
- func (o *RednerdAPI) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RednerdAPI ¶
type RednerdAPI 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/io.orus.rednerd.v1+json // - application/json JSONConsumer runtime.Consumer // JSONProducer registers a producer for the following mime types: // - application/io.orus.rednerd.v1+json JSONProducer runtime.Producer // ApikeyAuth registers a function that takes a token and returns a principal // it performs authentication based on an api key Rednerd-API-Key provided in the header ApikeyAuth func(string) (*models.Principal, error) // CookieAuth registers a function that takes a token and returns a principal // it performs authentication based on an api key Cookie provided in the header CookieAuth func(string) (*models.Principal, error) // TokenAuth registers a function that takes a token and returns a principal // it performs authentication based on an api key Authorization provided in the header TokenAuth func(string) (*models.Principal, error) // APIAuthorizer provides access control (ACL/RBAC/ABAC) by providing access to the request and authenticated principal APIAuthorizer runtime.Authorizer // TemplateManagementAccountTemplateAddHandler sets the operation handler for the account template add operation TemplateManagementAccountTemplateAddHandler template_management.AccountTemplateAddHandler // TemplateManagementAccountTemplateDeleteHandler sets the operation handler for the account template delete operation TemplateManagementAccountTemplateDeleteHandler template_management.AccountTemplateDeleteHandler // TemplateManagementAccountTemplateGetHandler sets the operation handler for the account template get operation TemplateManagementAccountTemplateGetHandler template_management.AccountTemplateGetHandler // TemplateManagementAccountTemplateListHandler sets the operation handler for the account template list operation TemplateManagementAccountTemplateListHandler template_management.AccountTemplateListHandler // TemplateManagementAccountTemplatePreviewHandler sets the operation handler for the account template preview operation TemplateManagementAccountTemplatePreviewHandler template_management.AccountTemplatePreviewHandler // TemplateManagementAccountTemplateUpdateHandler sets the operation handler for the account template update operation TemplateManagementAccountTemplateUpdateHandler template_management.AccountTemplateUpdateHandler // AuthAuthenticateHandler sets the operation handler for the authenticate operation AuthAuthenticateHandler auth.AuthenticateHandler // AuthForgotPasswordHandler sets the operation handler for the forgot password operation AuthForgotPasswordHandler auth.ForgotPasswordHandler // AuthLogoutHandler sets the operation handler for the logout operation AuthLogoutHandler auth.LogoutHandler // AuthRefreshTokenHandler sets the operation handler for the refresh token operation AuthRefreshTokenHandler auth.RefreshTokenHandler // AuthRegisterHandler sets the operation handler for the register operation AuthRegisterHandler auth.RegisterHandler // RenderingRenderHandler sets the operation handler for the render operation RenderingRenderHandler rendering.RenderHandler // RenderingRenderOneHandler sets the operation handler for the render one operation RenderingRenderOneHandler rendering.RenderOneHandler // AdminRenderlogsHandler sets the operation handler for the renderlogs operation AdminRenderlogsHandler admin.RenderlogsHandler // AuthResetPasswordHandler sets the operation handler for the reset password operation AuthResetPasswordHandler auth.ResetPasswordHandler // TemplateManagementTemplateListHandler sets the operation handler for the template list operation TemplateManagementTemplateListHandler template_management.TemplateListHandler // RenderingTemplateRenderHandler sets the operation handler for the template render operation RenderingTemplateRenderHandler rendering.TemplateRenderHandler // TemplateManagementTemplateVarlistHandler sets the operation handler for the template varlist operation TemplateManagementTemplateVarlistHandler template_management.TemplateVarlistHandler // UserManagementUserAddHandler sets the operation handler for the user add operation UserManagementUserAddHandler user_management.UserAddHandler // UserManagementUserApikeyAddHandler sets the operation handler for the user apikey add operation UserManagementUserApikeyAddHandler user_management.UserApikeyAddHandler // UserManagementUserApikeyDeleteHandler sets the operation handler for the user apikey delete operation UserManagementUserApikeyDeleteHandler user_management.UserApikeyDeleteHandler // UserManagementUserApikeyListHandler sets the operation handler for the user apikey list operation UserManagementUserApikeyListHandler user_management.UserApikeyListHandler // UserManagementUserDeleteHandler sets the operation handler for the user delete operation UserManagementUserDeleteHandler user_management.UserDeleteHandler // UserManagementUserGetHandler sets the operation handler for the user get operation UserManagementUserGetHandler user_management.UserGetHandler // UserManagementUserListHandler sets the operation handler for the user list operation UserManagementUserListHandler user_management.UserListHandler // UserManagementUserPasswordDeleteHandler sets the operation handler for the user password delete operation UserManagementUserPasswordDeleteHandler user_management.UserPasswordDeleteHandler // UserManagementUserPasswordSetHandler sets the operation handler for the user password set operation UserManagementUserPasswordSetHandler user_management.UserPasswordSetHandler // UserManagementUserUpdateHandler sets the operation handler for the user update operation UserManagementUserUpdateHandler user_management.UserUpdateHandler // AuthUserinfoHandler sets the operation handler for the userinfo operation AuthUserinfoHandler auth.UserinfoHandler // 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 }
RednerdAPI The Rednerd rendering server. For a list of available rendering engines and their options, see <a href="/docs/engines">Rednerd Engines</a>.
func NewRednerdAPI ¶
func NewRednerdAPI(spec *loads.Document) *RednerdAPI
NewRednerdAPI creates a new Rednerd instance
func (*RednerdAPI) AddMiddlewareFor ¶
func (o *RednerdAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
AddMiddlewareFor adds a http middleware to existing handler
func (*RednerdAPI) AuthenticatorsFor ¶
func (o *RednerdAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*RednerdAPI) Authorizer ¶
func (o *RednerdAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*RednerdAPI) ConsumersFor ¶
func (o *RednerdAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
ConsumersFor gets the consumers for the specified media types. MIME type parameters are ignored here.
func (*RednerdAPI) Context ¶
func (o *RednerdAPI) Context() *middleware.Context
Context returns the middleware context for the rednerd API
func (*RednerdAPI) DefaultConsumes ¶
func (o *RednerdAPI) DefaultConsumes() string
DefaultConsumes returns the default consumes media type
func (*RednerdAPI) DefaultProduces ¶
func (o *RednerdAPI) DefaultProduces() string
DefaultProduces returns the default produces media type
func (*RednerdAPI) Formats ¶
func (o *RednerdAPI) Formats() strfmt.Registry
Formats returns the registered string formats
func (*RednerdAPI) HandlerFor ¶
func (o *RednerdAPI) HandlerFor(method, path string) (http.Handler, bool)
HandlerFor gets a http.Handler for the provided operation method and path
func (*RednerdAPI) Init ¶
func (o *RednerdAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*RednerdAPI) LoggingInstrumentHandlers ¶
func (o *RednerdAPI) LoggingInstrumentHandlers()
func (*RednerdAPI) ProducersFor ¶
func (o *RednerdAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
ProducersFor gets the producers for the specified media types. MIME type parameters are ignored here.
func (*RednerdAPI) PrometheusInstrumentHandlers ¶
func (o *RednerdAPI) PrometheusInstrumentHandlers()
func (*RednerdAPI) RegisterConsumer ¶
func (o *RednerdAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*RednerdAPI) RegisterFormat ¶
RegisterFormat registers a custom format validator
func (*RednerdAPI) RegisterProducer ¶
func (o *RednerdAPI) RegisterProducer(mediaType string, producer runtime.Producer)
RegisterProducer allows you to add (or override) a producer for a media type.
func (*RednerdAPI) Serve ¶
func (o *RednerdAPI) 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 (*RednerdAPI) ServeErrorFor ¶
func (o *RednerdAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*RednerdAPI) SetDefaultConsumes ¶
func (o *RednerdAPI) SetDefaultConsumes(mediaType string)
SetDefaultConsumes returns the default consumes media type
func (*RednerdAPI) SetDefaultProduces ¶
func (o *RednerdAPI) SetDefaultProduces(mediaType string)
SetDefaultProduces sets the default produces media type
func (*RednerdAPI) SetSpec ¶
func (o *RednerdAPI) SetSpec(spec *loads.Document)
SetSpec sets a spec that will be served for the clients.
func (*RednerdAPI) Validate ¶
func (o *RednerdAPI) Validate() error
Validate validates the registrations in the RednerdAPI