operations

package
v2.0.11 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 18 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
	// AdminAddFrontendGrantHandler sets the operation handler for the add frontend grant operation
	AdminAddFrontendGrantHandler admin.AddFrontendGrantHandler
	// AdminAddNamespaceFrontendMappingHandler sets the operation handler for the add namespace frontend mapping operation
	AdminAddNamespaceFrontendMappingHandler admin.AddNamespaceFrontendMappingHandler
	// AdminAddNamespaceGrantHandler sets the operation handler for the add namespace grant operation
	AdminAddNamespaceGrantHandler admin.AddNamespaceGrantHandler
	// AdminAddOrganizationMemberHandler sets the operation handler for the add organization member operation
	AdminAddOrganizationMemberHandler admin.AddOrganizationMemberHandler
	// AdminApplyLimitClassesHandler sets the operation handler for the apply limit classes operation
	AdminApplyLimitClassesHandler admin.ApplyLimitClassesHandler
	// AccountChangePasswordHandler sets the operation handler for the change password operation
	AccountChangePasswordHandler account.ChangePasswordHandler
	// MetadataClientVersionCheckHandler sets the operation handler for the client version check operation
	MetadataClientVersionCheckHandler metadata.ClientVersionCheckHandler
	// 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
	// AdminCreateNamespaceHandler sets the operation handler for the create namespace operation
	AdminCreateNamespaceHandler admin.CreateNamespaceHandler
	// AdminCreateOrganizationHandler sets the operation handler for the create organization operation
	AdminCreateOrganizationHandler admin.CreateOrganizationHandler
	// ShareCreateShareNameHandler sets the operation handler for the create share name operation
	ShareCreateShareNameHandler share.CreateShareNameHandler
	// AdminDeleteAccountHandler sets the operation handler for the delete account operation
	AdminDeleteAccountHandler admin.DeleteAccountHandler
	// AdminDeleteFrontendHandler sets the operation handler for the delete frontend operation
	AdminDeleteFrontendHandler admin.DeleteFrontendHandler
	// AdminDeleteFrontendGrantHandler sets the operation handler for the delete frontend grant operation
	AdminDeleteFrontendGrantHandler admin.DeleteFrontendGrantHandler
	// AdminDeleteIdentityHandler sets the operation handler for the delete identity operation
	AdminDeleteIdentityHandler admin.DeleteIdentityHandler
	// AdminDeleteNamespaceHandler sets the operation handler for the delete namespace operation
	AdminDeleteNamespaceHandler admin.DeleteNamespaceHandler
	// AdminDeleteOrganizationHandler sets the operation handler for the delete organization operation
	AdminDeleteOrganizationHandler admin.DeleteOrganizationHandler
	// ShareDeleteShareNameHandler sets the operation handler for the delete share name operation
	ShareDeleteShareNameHandler share.DeleteShareNameHandler
	// EnvironmentDisableHandler sets the operation handler for the disable operation
	EnvironmentDisableHandler environment.DisableHandler
	// EnvironmentEnableHandler sets the operation handler for the enable operation
	EnvironmentEnableHandler environment.EnableHandler
	// AgentEnrollHandler sets the operation handler for the enroll operation
	AgentEnrollHandler agent.EnrollHandler
	// 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
	// AdminGetNameHandler sets the operation handler for the get name operation
	AdminGetNameHandler admin.GetNameHandler
	// 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
	// AdminGetSkipInterstitialGrantHandler sets the operation handler for the get skip interstitial grant operation
	AdminGetSkipInterstitialGrantHandler admin.GetSkipInterstitialGrantHandler
	// MetadataGetSparklinesHandler sets the operation handler for the get sparklines operation
	MetadataGetSparklinesHandler metadata.GetSparklinesHandler
	// AdminGrantSkipInterstitialHandler sets the operation handler for the grant skip interstitial operation
	AdminGrantSkipInterstitialHandler admin.GrantSkipInterstitialHandler
	// 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
	// MetadataListAccessesHandler sets the operation handler for the list accesses operation
	MetadataListAccessesHandler metadata.ListAccessesHandler
	// ShareListAllNamesHandler sets the operation handler for the list all names operation
	ShareListAllNamesHandler share.ListAllNamesHandler
	// AdminListAppliedLimitClassesHandler sets the operation handler for the list applied limit classes operation
	AdminListAppliedLimitClassesHandler admin.ListAppliedLimitClassesHandler
	// MetadataListEnvironmentsHandler sets the operation handler for the list environments operation
	MetadataListEnvironmentsHandler metadata.ListEnvironmentsHandler
	// AdminListFrontendNamespaceMappingsHandler sets the operation handler for the list frontend namespace mappings operation
	AdminListFrontendNamespaceMappingsHandler admin.ListFrontendNamespaceMappingsHandler
	// AdminListFrontendsHandler sets the operation handler for the list frontends operation
	AdminListFrontendsHandler admin.ListFrontendsHandler
	// AdminListLimitClassesHandler sets the operation handler for the list limit classes operation
	AdminListLimitClassesHandler admin.ListLimitClassesHandler
	// MetadataListMembershipsHandler sets the operation handler for the list memberships operation
	MetadataListMembershipsHandler metadata.ListMembershipsHandler
	// ShareListNamesForNamespaceHandler sets the operation handler for the list names for namespace operation
	ShareListNamesForNamespaceHandler share.ListNamesForNamespaceHandler
	// AdminListNamespaceFrontendMappingsHandler sets the operation handler for the list namespace frontend mappings operation
	AdminListNamespaceFrontendMappingsHandler admin.ListNamespaceFrontendMappingsHandler
	// AdminListNamespacesHandler sets the operation handler for the list namespaces operation
	AdminListNamespacesHandler admin.ListNamespacesHandler
	// 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
	// ShareListShareNamespacesHandler sets the operation handler for the list share namespaces operation
	ShareListShareNamespacesHandler share.ListShareNamespacesHandler
	// MetadataListSharesHandler sets the operation handler for the list shares operation
	MetadataListSharesHandler metadata.ListSharesHandler
	// 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
	// AgentPingHandler sets the operation handler for the ping operation
	AgentPingHandler agent.PingHandler
	// AccountRegenerateAccountTokenHandler sets the operation handler for the regenerate account token operation
	AccountRegenerateAccountTokenHandler account.RegenerateAccountTokenHandler
	// AccountRegisterHandler sets the operation handler for the register operation
	AccountRegisterHandler account.RegisterHandler
	// AgentRemoteAccessHandler sets the operation handler for the remote access operation
	AgentRemoteAccessHandler agent.RemoteAccessHandler
	// AgentRemoteShareHandler sets the operation handler for the remote share operation
	AgentRemoteShareHandler agent.RemoteShareHandler
	// AgentRemoteStatusHandler sets the operation handler for the remote status operation
	AgentRemoteStatusHandler agent.RemoteStatusHandler
	// AgentRemoteUnaccessHandler sets the operation handler for the remote unaccess operation
	AgentRemoteUnaccessHandler agent.RemoteUnaccessHandler
	// AgentRemoteUnshareHandler sets the operation handler for the remote unshare operation
	AgentRemoteUnshareHandler agent.RemoteUnshareHandler
	// AdminRemoveAppliedLimitClassesHandler sets the operation handler for the remove applied limit classes operation
	AdminRemoveAppliedLimitClassesHandler admin.RemoveAppliedLimitClassesHandler
	// AdminRemoveNamespaceFrontendMappingHandler sets the operation handler for the remove namespace frontend mapping operation
	AdminRemoveNamespaceFrontendMappingHandler admin.RemoveNamespaceFrontendMappingHandler
	// AdminRemoveNamespaceGrantHandler sets the operation handler for the remove namespace grant operation
	AdminRemoveNamespaceGrantHandler admin.RemoveNamespaceGrantHandler
	// 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
	// AdminRevokeSkipInterstitialHandler sets the operation handler for the revoke skip interstitial operation
	AdminRevokeSkipInterstitialHandler admin.RevokeSkipInterstitialHandler
	// ShareShareHandler sets the operation handler for the share operation
	ShareShareHandler share.ShareHandler
	// AgentShareHTTPHealthcheckHandler sets the operation handler for the share Http healthcheck operation
	AgentShareHTTPHealthcheckHandler agent.ShareHTTPHealthcheckHandler
	// ShareUnaccessHandler sets the operation handler for the unaccess operation
	ShareUnaccessHandler share.UnaccessHandler
	// AgentUnenrollHandler sets the operation handler for the unenroll operation
	AgentUnenrollHandler agent.UnenrollHandler
	// ShareUnshareHandler sets the operation handler for the unshare operation
	ShareUnshareHandler share.UnshareHandler
	// ShareUpdateAccessHandler sets the operation handler for the update access operation
	ShareUpdateAccessHandler share.UpdateAccessHandler
	// AdminUpdateAccountPasswordHandler sets the operation handler for the update account password operation
	AdminUpdateAccountPasswordHandler admin.UpdateAccountPasswordHandler
	// AdminUpdateFrontendHandler sets the operation handler for the update frontend operation
	AdminUpdateFrontendHandler admin.UpdateFrontendHandler
	// AdminUpdateNamespaceHandler sets the operation handler for the update namespace operation
	AdminUpdateNamespaceHandler admin.UpdateNamespaceHandler
	// ShareUpdateShareHandler sets the operation handler for the update share operation
	ShareUpdateShareHandler share.UpdateShareHandler
	// ShareUpdateShareNameHandler sets the operation handler for the update share name operation
	ShareUpdateShareNameHandler share.UpdateShareNameHandler
	// AccountVerifyHandler sets the operation handler for the verify operation
	AccountVerifyHandler account.VerifyHandler
	// MetadataVersionHandler sets the operation handler for the version operation
	MetadataVersionHandler metadata.VersionHandler
	// MetadataVersionInventoryHandler sets the operation handler for the version inventory operation
	MetadataVersionInventoryHandler metadata.VersionInventoryHandler

	// 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, ...any)
	// 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
⌂ 换网址