operations

package
v0.4.45 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZrokAPI

type ZrokAPI 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/zrok.v1+json
	JSONConsumer runtime.Consumer

	// JSONProducer registers a producer for the following mime types:
	//   - application/zrok.v1+json
	JSONProducer runtime.Producer

	// KeyAuth registers a function that takes a token and returns a principal
	// it performs authentication based on an api key x-token provided in the header
	KeyAuth func(string) (*rest_model_zrok.Principal, error)

	// APIAuthorizer provides access control (ACL/RBAC/ABAC) by providing access to the request and authenticated principal
	APIAuthorizer runtime.Authorizer

	// ShareAccessHandler sets the operation handler for the access operation
	ShareAccessHandler share.AccessHandler
	// AdminAddOrganizationMemberHandler sets the operation handler for the add organization member operation
	AdminAddOrganizationMemberHandler admin.AddOrganizationMemberHandler
	// AccountChangePasswordHandler sets the operation handler for the change password operation
	AccountChangePasswordHandler account.ChangePasswordHandler
	// MetadataConfigurationHandler sets the operation handler for the configuration operation
	MetadataConfigurationHandler metadata.ConfigurationHandler
	// AdminCreateAccountHandler sets the operation handler for the create account operation
	AdminCreateAccountHandler admin.CreateAccountHandler
	// AdminCreateFrontendHandler sets the operation handler for the create frontend operation
	AdminCreateFrontendHandler admin.CreateFrontendHandler
	// AdminCreateIdentityHandler sets the operation handler for the create identity operation
	AdminCreateIdentityHandler admin.CreateIdentityHandler
	// AdminCreateOrganizationHandler sets the operation handler for the create organization operation
	AdminCreateOrganizationHandler admin.CreateOrganizationHandler
	// AdminDeleteFrontendHandler sets the operation handler for the delete frontend operation
	AdminDeleteFrontendHandler admin.DeleteFrontendHandler
	// AdminDeleteOrganizationHandler sets the operation handler for the delete organization operation
	AdminDeleteOrganizationHandler admin.DeleteOrganizationHandler
	// EnvironmentDisableHandler sets the operation handler for the disable operation
	EnvironmentDisableHandler environment.DisableHandler
	// EnvironmentEnableHandler sets the operation handler for the enable operation
	EnvironmentEnableHandler environment.EnableHandler
	// MetadataGetAccountDetailHandler sets the operation handler for the get account detail operation
	MetadataGetAccountDetailHandler metadata.GetAccountDetailHandler
	// MetadataGetAccountMetricsHandler sets the operation handler for the get account metrics operation
	MetadataGetAccountMetricsHandler metadata.GetAccountMetricsHandler
	// MetadataGetEnvironmentDetailHandler sets the operation handler for the get environment detail operation
	MetadataGetEnvironmentDetailHandler metadata.GetEnvironmentDetailHandler
	// MetadataGetEnvironmentMetricsHandler sets the operation handler for the get environment metrics operation
	MetadataGetEnvironmentMetricsHandler metadata.GetEnvironmentMetricsHandler
	// MetadataGetFrontendDetailHandler sets the operation handler for the get frontend detail operation
	MetadataGetFrontendDetailHandler metadata.GetFrontendDetailHandler
	// MetadataGetShareDetailHandler sets the operation handler for the get share detail operation
	MetadataGetShareDetailHandler metadata.GetShareDetailHandler
	// MetadataGetShareMetricsHandler sets the operation handler for the get share metrics operation
	MetadataGetShareMetricsHandler metadata.GetShareMetricsHandler
	// AdminGrantsHandler sets the operation handler for the grants operation
	AdminGrantsHandler admin.GrantsHandler
	// AccountInviteHandler sets the operation handler for the invite operation
	AccountInviteHandler account.InviteHandler
	// AdminInviteTokenGenerateHandler sets the operation handler for the invite token generate operation
	AdminInviteTokenGenerateHandler admin.InviteTokenGenerateHandler
	// AdminListFrontendsHandler sets the operation handler for the list frontends operation
	AdminListFrontendsHandler admin.ListFrontendsHandler
	// MetadataListMembershipsHandler sets the operation handler for the list memberships operation
	MetadataListMembershipsHandler metadata.ListMembershipsHandler
	// MetadataListOrgMembersHandler sets the operation handler for the list org members operation
	MetadataListOrgMembersHandler metadata.ListOrgMembersHandler
	// AdminListOrganizationMembersHandler sets the operation handler for the list organization members operation
	AdminListOrganizationMembersHandler admin.ListOrganizationMembersHandler
	// AdminListOrganizationsHandler sets the operation handler for the list organizations operation
	AdminListOrganizationsHandler admin.ListOrganizationsHandler
	// AccountLoginHandler sets the operation handler for the login operation
	AccountLoginHandler account.LoginHandler
	// MetadataOrgAccountOverviewHandler sets the operation handler for the org account overview operation
	MetadataOrgAccountOverviewHandler metadata.OrgAccountOverviewHandler
	// MetadataOverviewHandler sets the operation handler for the overview operation
	MetadataOverviewHandler metadata.OverviewHandler
	// AccountRegenerateTokenHandler sets the operation handler for the regenerate token operation
	AccountRegenerateTokenHandler account.RegenerateTokenHandler
	// AccountRegisterHandler sets the operation handler for the register operation
	AccountRegisterHandler account.RegisterHandler
	// AdminRemoveOrganizationMemberHandler sets the operation handler for the remove organization member operation
	AdminRemoveOrganizationMemberHandler admin.RemoveOrganizationMemberHandler
	// AccountResetPasswordHandler sets the operation handler for the reset password operation
	AccountResetPasswordHandler account.ResetPasswordHandler
	// AccountResetPasswordRequestHandler sets the operation handler for the reset password request operation
	AccountResetPasswordRequestHandler account.ResetPasswordRequestHandler
	// ShareShareHandler sets the operation handler for the share operation
	ShareShareHandler share.ShareHandler
	// ShareUnaccessHandler sets the operation handler for the unaccess operation
	ShareUnaccessHandler share.UnaccessHandler
	// ShareUnshareHandler sets the operation handler for the unshare operation
	ShareUnshareHandler share.UnshareHandler
	// AdminUpdateFrontendHandler sets the operation handler for the update frontend operation
	AdminUpdateFrontendHandler admin.UpdateFrontendHandler
	// ShareUpdateShareHandler sets the operation handler for the update share operation
	ShareUpdateShareHandler share.UpdateShareHandler
	// AccountVerifyHandler sets the operation handler for the verify operation
	AccountVerifyHandler account.VerifyHandler
	// MetadataVersionHandler sets the operation handler for the version operation
	MetadataVersionHandler metadata.VersionHandler

	// 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
}

ZrokAPI zrok client access

func NewZrokAPI

func NewZrokAPI(spec *loads.Document) *ZrokAPI

NewZrokAPI creates a new Zrok instance

func (*ZrokAPI) AddMiddlewareFor

func (o *ZrokAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)

AddMiddlewareFor adds a http middleware to existing handler

func (*ZrokAPI) AuthenticatorsFor

func (o *ZrokAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator

AuthenticatorsFor gets the authenticators for the specified security schemes

func (*ZrokAPI) Authorizer

func (o *ZrokAPI) Authorizer() runtime.Authorizer

Authorizer returns the registered authorizer

func (*ZrokAPI) ConsumersFor

func (o *ZrokAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer

ConsumersFor gets the consumers for the specified media types. MIME type parameters are ignored here.

func (*ZrokAPI) Context

func (o *ZrokAPI) Context() *middleware.Context

Context returns the middleware context for the zrok API

func (*ZrokAPI) DefaultConsumes

func (o *ZrokAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*ZrokAPI) DefaultProduces

func (o *ZrokAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*ZrokAPI) Formats

func (o *ZrokAPI) Formats() strfmt.Registry

Formats returns the registered string formats

func (*ZrokAPI) HandlerFor

func (o *ZrokAPI) HandlerFor(method, path string) (http.Handler, bool)

HandlerFor gets a http.Handler for the provided operation method and path

func (*ZrokAPI) Init

func (o *ZrokAPI) Init()

Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit

func (*ZrokAPI) ProducersFor

func (o *ZrokAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer

ProducersFor gets the producers for the specified media types. MIME type parameters are ignored here.

func (*ZrokAPI) RegisterConsumer

func (o *ZrokAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)

RegisterConsumer allows you to add (or override) a consumer for a media type.

func (*ZrokAPI) RegisterFormat

func (o *ZrokAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)

RegisterFormat registers a custom format validator

func (*ZrokAPI) RegisterProducer

func (o *ZrokAPI) RegisterProducer(mediaType string, producer runtime.Producer)

RegisterProducer allows you to add (or override) a producer for a media type.

func (*ZrokAPI) Serve

func (o *ZrokAPI) 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 (*ZrokAPI) ServeErrorFor

func (o *ZrokAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)

ServeErrorFor gets a error handler for a given operation id

func (*ZrokAPI) SetDefaultConsumes

func (o *ZrokAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*ZrokAPI) SetDefaultProduces

func (o *ZrokAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*ZrokAPI) SetSpec

func (o *ZrokAPI) SetSpec(spec *loads.Document)

SetSpec sets a spec that will be served for the clients.

func (*ZrokAPI) UseRedoc

func (o *ZrokAPI) UseRedoc()

UseRedoc for documentation at /docs

func (*ZrokAPI) UseSwaggerUI

func (o *ZrokAPI) UseSwaggerUI()

UseSwaggerUI for documentation at /docs

func (*ZrokAPI) Validate

func (o *ZrokAPI) Validate() error

Validate validates the registrations in the ZrokAPI

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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