session

package
v0.0.0-...-f9bae2f Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const SessionBadRequestCode int = 400

SessionBadRequestCode is the HTTP code returned for type SessionBadRequest

View Source
const SessionInternalServerErrorCode int = 500

SessionInternalServerErrorCode is the HTTP code returned for type SessionInternalServerError

View Source
const SessionSwitchingProtocolsCode int = 101

SessionSwitchingProtocolsCode is the HTTP code returned for type SessionSwitchingProtocols

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	Context *middleware.Context
	Handler SessionHandler
}
Session swagger:route POST /session Session session

Initialize interactive session

Start a new interactive session with a server. Session allows server to call back to the client for advanced capabilities.

### Hijacking

This endpoint hijacks the HTTP connection to HTTP2 transport that allows the client to expose gPRC services on that connection.

For example, the client sends this request to upgrade the connection:

``` POST /session HTTP/1.1 Upgrade: h2c Connection: Upgrade ```

The Docker daemon responds with a `101 UPGRADED` response follow with the raw stream:

``` HTTP/1.1 101 UPGRADED Connection: Upgrade Upgrade: h2c ```

func NewSession

func NewSession(ctx *middleware.Context, handler SessionHandler) *Session

NewSession creates a new http.Handler for the session operation

func (*Session) ServeHTTP

func (o *Session) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type SessionBadRequest

type SessionBadRequest struct {

	/*
	  In: Body
	*/
	Payload *models.ErrorResponse `json:"body,omitempty"`
}

SessionBadRequest bad parameter

swagger:response sessionBadRequest

func NewSessionBadRequest

func NewSessionBadRequest() *SessionBadRequest

NewSessionBadRequest creates SessionBadRequest with default headers values

func (*SessionBadRequest) SetPayload

func (o *SessionBadRequest) SetPayload(payload *models.ErrorResponse)

SetPayload sets the payload to the session bad request response

func (*SessionBadRequest) WithPayload

func (o *SessionBadRequest) WithPayload(payload *models.ErrorResponse) *SessionBadRequest

WithPayload adds the payload to the session bad request response

func (*SessionBadRequest) WriteResponse

func (o *SessionBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type SessionHandler

type SessionHandler interface {
	Handle(SessionParams) middleware.Responder
}

SessionHandler interface for that can handle valid session params

type SessionHandlerFunc

type SessionHandlerFunc func(SessionParams) middleware.Responder

SessionHandlerFunc turns a function with the right signature into a session handler

func (SessionHandlerFunc) Handle

Handle executing the request and returning a response

type SessionInternalServerError

type SessionInternalServerError struct {

	/*
	  In: Body
	*/
	Payload *models.ErrorResponse `json:"body,omitempty"`
}

SessionInternalServerError server error

swagger:response sessionInternalServerError

func NewSessionInternalServerError

func NewSessionInternalServerError() *SessionInternalServerError

NewSessionInternalServerError creates SessionInternalServerError with default headers values

func (*SessionInternalServerError) SetPayload

func (o *SessionInternalServerError) SetPayload(payload *models.ErrorResponse)

SetPayload sets the payload to the session internal server error response

func (*SessionInternalServerError) WithPayload

WithPayload adds the payload to the session internal server error response

func (*SessionInternalServerError) WriteResponse

func (o *SessionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type SessionParams

type SessionParams struct {

	// HTTP Request Object
	HTTPRequest *http.Request `json:"-"`
}

SessionParams contains all the bound params for the session operation typically these are obtained from a http.Request

swagger:parameters Session

func NewSessionParams

func NewSessionParams() SessionParams

NewSessionParams creates a new SessionParams object

There are no default values defined in the spec.

func (*SessionParams) BindRequest

func (o *SessionParams) 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 NewSessionParams() beforehand.

type SessionSwitchingProtocols

type SessionSwitchingProtocols struct {
}

SessionSwitchingProtocols no error, hijacking successful

swagger:response sessionSwitchingProtocols

func NewSessionSwitchingProtocols

func NewSessionSwitchingProtocols() *SessionSwitchingProtocols

NewSessionSwitchingProtocols creates SessionSwitchingProtocols with default headers values

func (*SessionSwitchingProtocols) WriteResponse

func (o *SessionSwitchingProtocols) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type SessionURL

type SessionURL struct {
	// contains filtered or unexported fields
}

SessionURL generates an URL for the session operation

func (*SessionURL) Build

func (o *SessionURL) Build() (*url.URL, error)

Build a url path and query string

func (*SessionURL) BuildFull

func (o *SessionURL) BuildFull(scheme, host string) (*url.URL, error)

BuildFull builds a full url with scheme, host, path and query string

func (*SessionURL) Must

func (o *SessionURL) Must(u *url.URL, err error) *url.URL

Must is a helper function to panic when the url builder returns an error

func (*SessionURL) SetBasePath

func (o *SessionURL) SetBasePath(bp string)

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 (*SessionURL) String

func (o *SessionURL) String() string

String returns the string representation of the path with query string

func (*SessionURL) StringFull

func (o *SessionURL) StringFull(scheme, host string) string

StringFull returns the string representation of a complete url

func (*SessionURL) WithBasePath

func (o *SessionURL) WithBasePath(bp string) *SessionURL

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

Jump to

Keyboard shortcuts

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