operations

package
v1.7.7-hanzo.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: AGPL-3.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 ConsoleAPI

type ConsoleAPI 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
	// MultipartformConsumer registers a consumer for the following mime types:
	//   - multipart/form-data
	MultipartformConsumer runtime.Consumer

	// BinProducer registers a producer for the following mime types:
	//   - application/octet-stream
	BinProducer runtime.Producer
	// JSONProducer registers a producer for the following mime types:
	//   - application/json
	JSONProducer runtime.Producer

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

	// KeyAuth registers a function that takes an access token and a collection of required scopes and returns a principal
	// it performs authentication based on an oauth2 bearer token provided in the request
	KeyAuth func(string, []string) (*models.Principal, error)

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

	// SystemAdminInfoHandler sets the operation handler for the admin info operation
	SystemAdminInfoHandler system.AdminInfoHandler
	// BucketBucketInfoHandler sets the operation handler for the bucket info operation
	BucketBucketInfoHandler bucket.BucketInfoHandler
	// ObjectDeleteMultipleObjectsHandler sets the operation handler for the delete multiple objects operation
	ObjectDeleteMultipleObjectsHandler object.DeleteMultipleObjectsHandler
	// ObjectDeleteObjectHandler sets the operation handler for the delete object operation
	ObjectDeleteObjectHandler object.DeleteObjectHandler
	// ObjectDownloadObjectHandler sets the operation handler for the download object operation
	ObjectDownloadObjectHandler object.DownloadObjectHandler
	// ObjectDownloadMultipleObjectsHandler sets the operation handler for the download multiple objects operation
	ObjectDownloadMultipleObjectsHandler object.DownloadMultipleObjectsHandler
	// PublicDownloadSharedObjectHandler sets the operation handler for the download shared object operation
	PublicDownloadSharedObjectHandler public.DownloadSharedObjectHandler
	// BucketGetBucketQuotaHandler sets the operation handler for the get bucket quota operation
	BucketGetBucketQuotaHandler bucket.GetBucketQuotaHandler
	// BucketGetBucketRewindHandler sets the operation handler for the get bucket rewind operation
	BucketGetBucketRewindHandler bucket.GetBucketRewindHandler
	// BucketGetBucketVersioningHandler sets the operation handler for the get bucket versioning operation
	BucketGetBucketVersioningHandler bucket.GetBucketVersioningHandler
	// BucketGetMaxShareLinkExpHandler sets the operation handler for the get max share link exp operation
	BucketGetMaxShareLinkExpHandler bucket.GetMaxShareLinkExpHandler
	// ObjectGetObjectMetadataHandler sets the operation handler for the get object metadata operation
	ObjectGetObjectMetadataHandler object.GetObjectMetadataHandler
	// LicenseLicenseAcknowledgeHandler sets the operation handler for the license acknowledge operation
	LicenseLicenseAcknowledgeHandler license.LicenseAcknowledgeHandler
	// BucketListBucketsHandler sets the operation handler for the list buckets operation
	BucketListBucketsHandler bucket.ListBucketsHandler
	// ObjectListObjectsHandler sets the operation handler for the list objects operation
	ObjectListObjectsHandler object.ListObjectsHandler
	// AuthLoginHandler sets the operation handler for the login operation
	AuthLoginHandler auth.LoginHandler
	// AuthLoginDetailHandler sets the operation handler for the login detail operation
	AuthLoginDetailHandler auth.LoginDetailHandler
	// AuthLogoutHandler sets the operation handler for the logout operation
	AuthLogoutHandler auth.LogoutHandler
	// BucketMakeBucketHandler sets the operation handler for the make bucket operation
	BucketMakeBucketHandler bucket.MakeBucketHandler
	// ObjectPostBucketsBucketNameObjectsUploadHandler sets the operation handler for the post buckets bucket name objects upload operation
	ObjectPostBucketsBucketNameObjectsUploadHandler object.PostBucketsBucketNameObjectsUploadHandler
	// ObjectPutObjectRestoreHandler sets the operation handler for the put object restore operation
	ObjectPutObjectRestoreHandler object.PutObjectRestoreHandler
	// ObjectPutObjectTagsHandler sets the operation handler for the put object tags operation
	ObjectPutObjectTagsHandler object.PutObjectTagsHandler
	// AuthSessionCheckHandler sets the operation handler for the session check operation
	AuthSessionCheckHandler auth.SessionCheckHandler
	// BucketSetBucketVersioningHandler sets the operation handler for the set bucket versioning operation
	BucketSetBucketVersioningHandler bucket.SetBucketVersioningHandler
	// ObjectShareObjectHandler sets the operation handler for the share object operation
	ObjectShareObjectHandler object.ShareObjectHandler

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

ConsoleAPI the console API

func NewConsoleAPI

func NewConsoleAPI(spec *loads.Document) *ConsoleAPI

NewConsoleAPI creates a new Console instance

func (*ConsoleAPI) AddMiddlewareFor

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

AddMiddlewareFor adds a http middleware to existing handler

func (*ConsoleAPI) AuthenticatorsFor

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

AuthenticatorsFor gets the authenticators for the specified security schemes

func (*ConsoleAPI) Authorizer

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

Authorizer returns the registered authorizer

func (*ConsoleAPI) ConsumersFor

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

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

func (*ConsoleAPI) Context

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

Context returns the middleware context for the console API

func (*ConsoleAPI) DefaultConsumes

func (o *ConsoleAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*ConsoleAPI) DefaultProduces

func (o *ConsoleAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*ConsoleAPI) Formats

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

Formats returns the registered string formats

func (*ConsoleAPI) HandlerFor

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

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

func (*ConsoleAPI) Init

func (o *ConsoleAPI) Init()

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

func (*ConsoleAPI) ProducersFor

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

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

func (*ConsoleAPI) RegisterConsumer

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

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

func (*ConsoleAPI) RegisterFormat

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

RegisterFormat registers a custom format validator

func (*ConsoleAPI) RegisterProducer

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

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

func (*ConsoleAPI) Serve

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

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

ServeErrorFor gets a error handler for a given operation id

func (*ConsoleAPI) SetDefaultConsumes

func (o *ConsoleAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*ConsoleAPI) SetDefaultProduces

func (o *ConsoleAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*ConsoleAPI) SetSpec

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

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

func (*ConsoleAPI) UseRedoc

func (o *ConsoleAPI) UseRedoc()

UseRedoc for documentation at /docs

func (*ConsoleAPI) UseSwaggerUI

func (o *ConsoleAPI) UseSwaggerUI()

UseSwaggerUI for documentation at /docs

func (*ConsoleAPI) Validate

func (o *ConsoleAPI) Validate() error

Validate validates the registrations in the ConsoleAPI

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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