handler

package
v0.0.0-...-28b0f66 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2017 License: MIT, Zlib Imports: 25 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ErrInvalidCredentialsFormat is an error raised when credentials format is not valid
	ErrInvalidCredentialsFormat = dockm.Error("Invalid credentials format")
	// ErrInvalidCredentials is an error raised when credentials for a user are invalid
	ErrInvalidCredentials = dockm.Error("Invalid credentials")
	// ErrAuthDisabled is an error raised when trying to access the authentication endpoints
	// when the server has been started with the --no-auth flag
	ErrAuthDisabled = dockm.Error("Authentication is disabled")
)
View Source
const (
	// ErrInvalidJSON defines an error raised the app is unable to parse request data
	ErrInvalidJSON = dockm.Error("Invalid JSON")
	// ErrInvalidRequestFormat defines an error raised when the format of the data sent in a request is not valid
	ErrInvalidRequestFormat = dockm.Error("Invalid request data format")
	// ErrInvalidQueryFormat defines an error raised when the data sent in the query or the URL is invalid
	ErrInvalidQueryFormat = dockm.Error("Invalid query format")
)
View Source
const (
	// ErrEndpointManagementDisabled is an error raised when trying to access the endpoints management endpoints
	// when the server has been started with the --external-endpoints flag
	ErrEndpointManagementDisabled = dockm.Error("Endpoint management is disabled")
)
View Source
const (
	// ErrEndpointManagementDisabled is an error raised when trying to access the endpoints management endpoints
	// when the server has been started with the --external-endpoints flag
	ErrapptocManagementDisabled = dockm.Error("Endpoint management is disabled")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppToContainerHandler

type AppToContainerHandler struct {
	*mux.Router
	Logger *log.Logger

	AppToContainerService dockm.AppToContainerService
	EndpointService       dockm.EndpointService
	// contains filtered or unexported fields
}

AppToContainerHandler represents an HTTP API handler for managing AppToContainer

func NewAppToContainerHandler

func NewAppToContainerHandler(bouncer *security.RequestBouncer, authorizeAppToContainerManagement bool) *AppToContainerHandler

NewEndpointHandler returns a new instance of EndpointHandler.

type AuthHandler

type AuthHandler struct {
	*mux.Router
	Logger *log.Logger

	UserService     dockm.UserService
	CryptoService   dockm.CryptoService
	JWTService      dockm.JWTService
	LDAPService     dockm.LDAPService
	SettingsService dockm.SettingsService
	// contains filtered or unexported fields
}

AuthHandler represents an HTTP API handler for managing authentication.

func NewAuthHandler

func NewAuthHandler(bouncer *security.RequestBouncer, authDisabled bool) *AuthHandler

NewAuthHandler returns a new instance of AuthHandler.

type DockerHandler

type DockerHandler struct {
	*mux.Router
	Logger                *log.Logger
	EndpointService       dockm.EndpointService
	TeamMembershipService dockm.TeamMembershipService
	ProxyManager          *proxy.Manager
}

DockerHandler represents an HTTP API handler for proxying requests to the Docker API.

func NewDockerHandler

func NewDockerHandler(bouncer *security.RequestBouncer) *DockerHandler

NewDockerHandler returns a new instance of DockerHandler.

type DockerHubHandler

type DockerHubHandler struct {
	*mux.Router
	Logger           *log.Logger
	DockerHubService dockm.DockerHubService
}

DockerHubHandler represents an HTTP API handler for managing DockerHub.

func NewDockerHubHandler

func NewDockerHubHandler(bouncer *security.RequestBouncer) *DockerHubHandler

NewDockerHubHandler returns a new instance of NewDockerHubHandler.

type EndpointHandler

type EndpointHandler struct {
	*mux.Router
	Logger *log.Logger

	EndpointService dockm.EndpointService
	FileService     dockm.FileService
	ProxyManager    *proxy.Manager
	// contains filtered or unexported fields
}

EndpointHandler represents an HTTP API handler for managing Docker endpoints.

func NewEndpointHandler

func NewEndpointHandler(bouncer *security.RequestBouncer, authorizeEndpointManagement bool) *EndpointHandler

NewEndpointHandler returns a new instance of EndpointHandler.

type FileHandler

type FileHandler struct {
	http.Handler
	Logger *log.Logger
	// contains filtered or unexported fields
}

FileHandler represents an HTTP API handler for managing static files.

func NewFileHandler

func NewFileHandler(assetPath string) *FileHandler

NewFileHandler returns a new instance of FileHandler.

func (*FileHandler) ServeHTTP

func (handler *FileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Handler

type Handler struct {
	AuthHandler           *AuthHandler
	UserHandler           *UserHandler
	TeamHandler           *TeamHandler
	TeamMembershipHandler *TeamMembershipHandler
	EndpointHandler       *EndpointHandler
	AppToContainerHandler *AppToContainerHandler //click2cloud-apptocontainer
	RegistryHandler       *RegistryHandler
	DockerHubHandler      *DockerHubHandler
	ResourceHandler       *ResourceHandler
	StackHandler          *StackHandler
	StatusHandler         *StatusHandler
	SettingsHandler       *SettingsHandler
	TemplatesHandler      *TemplatesHandler
	DockerHandler         *DockerHandler
	WebSocketHandler      *WebSocketHandler
	UploadHandler         *UploadHandler
	FileHandler           *FileHandler
}

Handler is a collection of all the service handlers.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP delegates a request to the appropriate subhandler.

type RegistryHandler

type RegistryHandler struct {
	*mux.Router
	Logger          *log.Logger
	RegistryService dockm.RegistryService
}

RegistryHandler represents an HTTP API handler for managing Docker registries.

func NewRegistryHandler

func NewRegistryHandler(bouncer *security.RequestBouncer) *RegistryHandler

NewRegistryHandler returns a new instance of RegistryHandler.

type ResourceHandler

type ResourceHandler struct {
	*mux.Router
	Logger                 *log.Logger
	ResourceControlService dockm.ResourceControlService
}

ResourceHandler represents an HTTP API handler for managing resource controls.

func NewResourceHandler

func NewResourceHandler(bouncer *security.RequestBouncer) *ResourceHandler

NewResourceHandler returns a new instance of ResourceHandler.

type SettingsHandler

type SettingsHandler struct {
	*mux.Router
	Logger          *log.Logger
	SettingsService dockm.SettingsService
	LDAPService     dockm.LDAPService
	FileService     dockm.FileService
}

SettingsHandler represents an HTTP API handler for managing Settings.

func NewSettingsHandler

func NewSettingsHandler(bouncer *security.RequestBouncer) *SettingsHandler

NewSettingsHandler returns a new instance of OldSettingsHandler.

type StackHandler

type StackHandler struct {
	*mux.Router
	Logger          *log.Logger
	FileService     dockm.FileService
	StackService    dockm.StackService
	EndpointService dockm.EndpointService
	StackManager    dockm.StackManager
}

StackHandler represents an HTTP API handler for managing Stack.

func NewStackHandler

func NewStackHandler(bouncer *security.RequestBouncer) *StackHandler

NewStackHandler returns a new instance of StackHandler.

type StatusHandler

type StatusHandler struct {
	*mux.Router
	Logger *log.Logger
	Status *dockm.Status
}

StatusHandler represents an HTTP API handler for managing Status.

func NewStatusHandler

func NewStatusHandler(bouncer *security.RequestBouncer, status *dockm.Status) *StatusHandler

NewStatusHandler returns a new instance of StatusHandler.

type TeamHandler

type TeamHandler struct {
	*mux.Router
	Logger                 *log.Logger
	TeamService            dockm.TeamService
	TeamMembershipService  dockm.TeamMembershipService
	ResourceControlService dockm.ResourceControlService
}

TeamHandler represents an HTTP API handler for managing teams.

func NewTeamHandler

func NewTeamHandler(bouncer *security.RequestBouncer) *TeamHandler

NewTeamHandler returns a new instance of TeamHandler.

type TeamMembershipHandler

type TeamMembershipHandler struct {
	*mux.Router
	Logger                 *log.Logger
	TeamMembershipService  dockm.TeamMembershipService
	ResourceControlService dockm.ResourceControlService
}

TeamMembershipHandler represents an HTTP API handler for managing teams.

func NewTeamMembershipHandler

func NewTeamMembershipHandler(bouncer *security.RequestBouncer) *TeamMembershipHandler

NewTeamMembershipHandler returns a new instance of TeamMembershipHandler.

type TemplatesHandler

type TemplatesHandler struct {
	*mux.Router
	Logger          *log.Logger
	SettingsService dockm.SettingsService
}

TemplatesHandler represents an HTTP API handler for managing templates.

func NewTemplatesHandler

func NewTemplatesHandler(bouncer *security.RequestBouncer) *TemplatesHandler

NewTemplatesHandler returns a new instance of TemplatesHandler.

type UploadHandler

type UploadHandler struct {
	*mux.Router
	Logger      *log.Logger
	FileService dockm.FileService
}

UploadHandler represents an HTTP API handler for managing file uploads.

func NewUploadHandler

func NewUploadHandler(bouncer *security.RequestBouncer) *UploadHandler

NewUploadHandler returns a new instance of UploadHandler.

type UserHandler

type UserHandler struct {
	*mux.Router
	Logger                 *log.Logger
	UserService            dockm.UserService
	TeamService            dockm.TeamService
	TeamMembershipService  dockm.TeamMembershipService
	ResourceControlService dockm.ResourceControlService
	CryptoService          dockm.CryptoService
	SettingsService        dockm.SettingsService
}

UserHandler represents an HTTP API handler for managing users.

func NewUserHandler

func NewUserHandler(bouncer *security.RequestBouncer) *UserHandler

NewUserHandler returns a new instance of UserHandler.

type WebSocketHandler

type WebSocketHandler struct {
	*mux.Router
	Logger          *log.Logger
	EndpointService dockm.EndpointService
}

WebSocketHandler represents an HTTP API handler for proxying requests to a web socket.

func NewWebSocketHandler

func NewWebSocketHandler() *WebSocketHandler

NewWebSocketHandler returns a new instance of WebSocketHandler.

Jump to

Keyboard shortcuts

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