Documentation ¶
Index ¶
- Constants
- func CanAccessStack(stack *baasapi.Stack, resourceControl *baasapi.ResourceControl, ...) bool
- type AzureTransport
- type ExtendedStack
- type Manager
- func (manager *Manager) CreateAndRegisterProxy(endpoint *baasapi.Endpoint) (http.Handler, error)
- func (manager *Manager) CreateExtensionProxy(extensionID baasapi.ExtensionID) (http.Handler, error)
- func (manager *Manager) CreateLegacyExtensionProxy(key, extensionAPIURL string) (http.Handler, error)
- func (manager *Manager) DeleteExtensionProxy(extensionID baasapi.ExtensionID)
- func (manager *Manager) DeleteProxy(key string)
- func (manager *Manager) GetExtensionProxy(extensionID baasapi.ExtensionID) http.Handler
- func (manager *Manager) GetExtensionURL(extensionID baasapi.ExtensionID) string
- func (manager *Manager) GetLegacyExtensionProxy(key string) http.Handler
- func (manager *Manager) GetProxy(key string) http.Handler
- type ManagerParams
Constants ¶
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") )
const AzureAPIBaseURL = "https://management.azure.com"
AzureAPIBaseURL is the URL where Azure API requests will be proxied.
const (
// ErrDockerConfigIdentifierNotFound defines an error raised when BaaSapi is unable to find a config identifier
ErrDockerConfigIdentifierNotFound = baasapi.Error("Docker config identifier not found")
)
const (
// ErrDockerContainerIdentifierNotFound defines an error raised when BaaSapi is unable to find a container identifier
ErrDockerContainerIdentifierNotFound = baasapi.Error("Docker container identifier not found")
)
const (
// ErrDockerNetworkIdentifierNotFound defines an error raised when BaaSapi is unable to find a network identifier
ErrDockerNetworkIdentifierNotFound = baasapi.Error("Docker network identifier not found")
)
const (
// ErrDockerSecretIdentifierNotFound defines an error raised when BaaSapi is unable to find a secret identifier
ErrDockerSecretIdentifierNotFound = baasapi.Error("Docker secret identifier not found")
)
const (
// ErrDockerServiceIdentifierNotFound defines an error raised when BaaSapi is unable to find a service identifier
ErrDockerServiceIdentifierNotFound = baasapi.Error("Docker service identifier not found")
)
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")
)
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.
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 ¶
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 ¶
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 ¶
DeleteProxy deletes the proxy associated to a key
func (*Manager) GetExtensionProxy ¶
GetExtensionProxy returns an extension proxy associated to an extension identifier
func (*Manager) GetExtensionURL ¶
GetExtensionURL retrieves the URL of an extension running locally based on the extension port table
func (*Manager) GetLegacyExtensionProxy ¶
GetLegacyExtensionProxy returns a legacy extension 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.