Documentation
¶
Index ¶
- Constants
- type AccessAPI
- func (o *AccessAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
- func (o *AccessAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *AccessAPI) Authorizer() runtime.Authorizer
- func (o *AccessAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *AccessAPI) Context() *middleware.Context
- func (o *AccessAPI) DefaultConsumes() string
- func (o *AccessAPI) DefaultProduces() string
- func (o *AccessAPI) Formats() strfmt.Registry
- func (o *AccessAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *AccessAPI) Init()
- func (o *AccessAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *AccessAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *AccessAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *AccessAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *AccessAPI) Serve(builder middleware.Builder) http.Handler
- func (o *AccessAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *AccessAPI) SetDefaultConsumes(mediaType string)
- func (o *AccessAPI) SetDefaultProduces(mediaType string)
- func (o *AccessAPI) SetSpec(spec *loads.Document)
- func (o *AccessAPI) UseRedoc()
- func (o *AccessAPI) UseSwaggerUI()
- func (o *AccessAPI) Validate() error
- type Shell
- type ShellHandler
- type ShellHandlerFunc
- type ShellOK
- type ShellOKBody
- type ShellParams
- type ShellURL
- func (o *ShellURL) Build() (*url.URL, error)
- func (o *ShellURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *ShellURL) Must(u *url.URL, err error) *url.URL
- func (o *ShellURL) SetBasePath(bp string)
- func (o *ShellURL) String() string
- func (o *ShellURL) StringFull(scheme, host string) string
- func (o *ShellURL) WithBasePath(bp string) *ShellURL
- type ShellUnauthorized
Constants ¶
const ShellOKCode int = 200
ShellOKCode is the HTTP code returned for type ShellOK
ShellUnauthorizedCode is the HTTP code returned for type ShellUnauthorized
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessAPI ¶
type AccessAPI 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 // BearerAuth registers a function that takes a token and returns a principal // it performs authentication based on an api key Authorization provided in the header BearerAuth func(string) (interface{}, error) // APIAuthorizer provides access control (ACL/RBAC/ABAC) by providing access to the request and authenticated principal APIAuthorizer runtime.Authorizer // ShellHandler sets the operation handler for the shell operation ShellHandler ShellHandler // 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 }
AccessAPI API for accessing github.com/practable/jump/internal/shellbar websocket relay
func NewAccessAPI ¶
NewAccessAPI creates a new Access instance
func (*AccessAPI) AddMiddlewareFor ¶
func (o *AccessAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
AddMiddlewareFor adds a http middleware to existing handler
func (*AccessAPI) AuthenticatorsFor ¶
func (o *AccessAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*AccessAPI) Authorizer ¶
func (o *AccessAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*AccessAPI) ConsumersFor ¶
ConsumersFor gets the consumers for the specified media types. MIME type parameters are ignored here.
func (*AccessAPI) Context ¶
func (o *AccessAPI) Context() *middleware.Context
Context returns the middleware context for the access API
func (*AccessAPI) DefaultConsumes ¶
DefaultConsumes returns the default consumes media type
func (*AccessAPI) DefaultProduces ¶
DefaultProduces returns the default produces media type
func (*AccessAPI) HandlerFor ¶
HandlerFor gets a http.Handler for the provided operation method and path
func (*AccessAPI) Init ¶
func (o *AccessAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*AccessAPI) ProducersFor ¶
ProducersFor gets the producers for the specified media types. MIME type parameters are ignored here.
func (*AccessAPI) RegisterConsumer ¶
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*AccessAPI) RegisterFormat ¶
RegisterFormat registers a custom format validator
func (*AccessAPI) RegisterProducer ¶
RegisterProducer allows you to add (or override) a producer for a media type.
func (*AccessAPI) Serve ¶
func (o *AccessAPI) 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 (*AccessAPI) ServeErrorFor ¶
func (o *AccessAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*AccessAPI) SetDefaultConsumes ¶
SetDefaultConsumes returns the default consumes media type
func (*AccessAPI) SetDefaultProduces ¶
SetDefaultProduces sets the default produces media type
func (*AccessAPI) UseSwaggerUI ¶
func (o *AccessAPI) UseSwaggerUI()
UseSwaggerUI for documentation at /docs
type Shell ¶
type Shell struct { Context *middleware.Context Handler ShellHandler }
Shell swagger:route POST /shell/{shell_id} shell
shell
access the specified shell host
func NewShell ¶
func NewShell(ctx *middleware.Context, handler ShellHandler) *Shell
NewShell creates a new http.Handler for the shell operation
type ShellHandler ¶
type ShellHandler interface {
Handle(ShellParams, interface{}) middleware.Responder
}
ShellHandler interface for that can handle valid shell params
type ShellHandlerFunc ¶
type ShellHandlerFunc func(ShellParams, interface{}) middleware.Responder
ShellHandlerFunc turns a function with the right signature into a shell handler
func (ShellHandlerFunc) Handle ¶
func (fn ShellHandlerFunc) Handle(params ShellParams, principal interface{}) middleware.Responder
Handle executing the request and returning a response
type ShellOK ¶
type ShellOK struct { /* In: Body */ Payload *ShellOKBody `json:"body,omitempty"` }
ShellOK shell o k
swagger:response shellOK
func (*ShellOK) SetPayload ¶
func (o *ShellOK) SetPayload(payload *ShellOKBody)
SetPayload sets the payload to the shell o k response
func (*ShellOK) WithPayload ¶
func (o *ShellOK) WithPayload(payload *ShellOKBody) *ShellOK
WithPayload adds the payload to the shell o k response
func (*ShellOK) WriteResponse ¶
func (o *ShellOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type ShellOKBody ¶
type ShellOKBody struct { // uri URI string `json:"uri,omitempty"` }
ShellOKBody shell o k body
swagger:model ShellOKBody
func (*ShellOKBody) MarshalBinary ¶
func (o *ShellOKBody) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*ShellOKBody) UnmarshalBinary ¶
func (o *ShellOKBody) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
type ShellParams ¶
type ShellParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /*Shell host identification code Required: true In: path */ ShellID string }
ShellParams contains all the bound params for the shell operation typically these are obtained from a http.Request
swagger:parameters shell
func NewShellParams ¶
func NewShellParams() ShellParams
NewShellParams creates a new ShellParams object no default values defined in spec.
func (*ShellParams) BindRequest ¶
func (o *ShellParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error
BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls.
To ensure default values, the struct must have been initialized with NewShellParams() beforehand.
type ShellURL ¶
type ShellURL struct { ShellID string // contains filtered or unexported fields }
ShellURL generates an URL for the shell operation
func (*ShellURL) SetBasePath ¶
SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string
func (*ShellURL) StringFull ¶
StringFull returns the string representation of a complete url
func (*ShellURL) WithBasePath ¶
WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string
type ShellUnauthorized ¶
type ShellUnauthorized struct {
Payload interface{} `json:"body,omitempty"`
}ShellUnauthorized Unauthorized
swagger:response shellUnauthorized
func NewShellUnauthorized ¶
func NewShellUnauthorized() *ShellUnauthorized
NewShellUnauthorized creates ShellUnauthorized with default headers values
func (*ShellUnauthorized) SetPayload ¶
func (o *ShellUnauthorized) SetPayload(payload interface{})
SetPayload sets the payload to the shell unauthorized response
func (*ShellUnauthorized) WithPayload ¶
func (o *ShellUnauthorized) WithPayload(payload interface{}) *ShellUnauthorized
WithPayload adds the payload to the shell unauthorized response
func (*ShellUnauthorized) WriteResponse ¶
func (o *ShellUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client