proxy

package
v0.0.0-...-b1a156a Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: Zlib Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrEmptyResponseBody defines an error raised when baasapi excepts to parse the body of a HTTP response and there is nothing to parse
	ErrEmptyResponseBody = baasapi.Error("Empty response body")
	// ErrInvalidResponseContent defines an error raised when BaaSapi excepts a JSON array and get something else.
	ErrInvalidResponseContent = baasapi.Error("Invalid Docker response")
)
View Source
const AzureAPIBaseURL = "https://management.azure.com"

AzureAPIBaseURL is the URL where Azure API requests will be proxied.

View Source
const (
	// ErrDockerConfigIdentifierNotFound defines an error raised when BaaSapi is unable to find a config identifier
	ErrDockerConfigIdentifierNotFound = baasapi.Error("Docker config identifier not found")
)
View Source
const (
	// ErrDockerContainerIdentifierNotFound defines an error raised when BaaSapi is unable to find a container identifier
	ErrDockerContainerIdentifierNotFound = baasapi.Error("Docker container identifier not found")
)
View Source
const (
	// ErrDockerNetworkIdentifierNotFound defines an error raised when BaaSapi is unable to find a network identifier
	ErrDockerNetworkIdentifierNotFound = baasapi.Error("Docker network identifier not found")
)
View Source
const (
	// ErrDockerSecretIdentifierNotFound defines an error raised when BaaSapi is unable to find a secret identifier
	ErrDockerSecretIdentifierNotFound = baasapi.Error("Docker secret identifier not found")
)
View Source
const (
	// ErrDockerServiceIdentifierNotFound defines an error raised when BaaSapi is unable to find a service identifier
	ErrDockerServiceIdentifierNotFound = baasapi.Error("Docker service identifier not found")
)
View Source
const (
	// ErrDockerTaskServiceIdentifierNotFound defines an error raised when BaaSapi is unable to find the service identifier associated to a task
	ErrDockerTaskServiceIdentifierNotFound = baasapi.Error("Docker task service identifier not found")
)
View Source
const (
	// ErrDockerVolumeIdentifierNotFound defines an error raised when BaaSapi is unable to find a volume identifier
	ErrDockerVolumeIdentifierNotFound = baasapi.Error("Docker volume identifier not found")
)

Variables

This section is empty.

Functions

func CanAccessStack

func CanAccessStack(stack *baasapi.Stack, resourceControl *baasapi.ResourceControl, userID baasapi.UserID, memberships []baasapi.TeamMembership) bool

CanAccessStack checks if a user can access a stack

Types

type AzureTransport

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

AzureTransport represents a transport used when executing HTTP requests against the Azure API.

func NewAzureTransport

func NewAzureTransport(credentials *baasapi.AzureCredentials) *AzureTransport

NewAzureTransport returns a pointer to an AzureTransport instance.

func (*AzureTransport) RoundTrip

func (transport *AzureTransport) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip is the implementation of the Transport interface.

type ExtendedStack

type ExtendedStack struct {
	baasapi.Stack
	ResourceControl baasapi.ResourceControl `json:"ResourceControl"`
}

ExtendedStack represents a stack combined with its associated access control

func FilterStacks

func FilterStacks(stacks []baasapi.Stack, resourceControls []baasapi.ResourceControl, isAdmin bool,
	userID baasapi.UserID, memberships []baasapi.TeamMembership) []ExtendedStack

FilterStacks filters stacks based on user role and resource controls.

type Manager

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

Manager represents a service used to manage Docker proxies.

func NewManager

func NewManager(parameters *ManagerParams) *Manager

NewManager initializes a new proxy Service

func (*Manager) CreateAndRegisterProxy

func (manager *Manager) CreateAndRegisterProxy(endpoint *baasapi.Endpoint) (http.Handler, error)

CreateAndRegisterProxy creates a new HTTP reverse proxy based on endpoint properties and and adds it to the registered proxies. It can also be used to create a new HTTP reverse proxy and replace an already registered proxy.

func (*Manager) CreateExtensionProxy

func (manager *Manager) CreateExtensionProxy(extensionID baasapi.ExtensionID) (http.Handler, error)

CreateExtensionProxy creates a new HTTP reverse proxy for an extension and registers it in the extension map associated to the specified extension identifier

func (*Manager) CreateLegacyExtensionProxy

func (manager *Manager) CreateLegacyExtensionProxy(key, extensionAPIURL string) (http.Handler, error)

CreateLegacyExtensionProxy creates a new HTTP reverse proxy for a legacy extension and adds it to the registered proxies.

func (*Manager) DeleteExtensionProxy

func (manager *Manager) DeleteExtensionProxy(extensionID baasapi.ExtensionID)

DeleteExtensionProxy deletes the extension proxy associated to an extension identifier

func (*Manager) DeleteProxy

func (manager *Manager) DeleteProxy(key string)

DeleteProxy deletes the proxy associated to a key

func (*Manager) GetExtensionProxy

func (manager *Manager) GetExtensionProxy(extensionID baasapi.ExtensionID) http.Handler

GetExtensionProxy returns an extension proxy associated to an extension identifier

func (*Manager) GetExtensionURL

func (manager *Manager) GetExtensionURL(extensionID baasapi.ExtensionID) string

GetExtensionURL retrieves the URL of an extension running locally based on the extension port table

func (*Manager) GetLegacyExtensionProxy

func (manager *Manager) GetLegacyExtensionProxy(key string) http.Handler

GetLegacyExtensionProxy returns a legacy extension proxy associated to a key

func (*Manager) GetProxy

func (manager *Manager) GetProxy(key string) http.Handler

GetProxy returns the proxy associated to a key

type ManagerParams

type ManagerParams struct {
	ResourceControlService baasapi.ResourceControlService
	TeamMembershipService  baasapi.TeamMembershipService
	SettingsService        baasapi.SettingsService
	RegistryService        baasapi.RegistryService
	DockerHubService       baasapi.DockerHubService
	SignatureService       baasapi.DigitalSignatureService
}

ManagerParams represents the required parameters to create a new Manager instance.

Jump to

Keyboard shortcuts

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