Documentation ¶
Index ¶
- Constants
- Variables
- type ApplyProjectOptions
- type CertificateManager
- func (c *CertificateManager) Authorize(domain string, token string) (string, error)
- func (c *CertificateManager) ChallengeCreate(domain string, challenge types.ChallengeType)
- func (c *CertificateManager) CleanUp(domain string, token string, auth string) error
- func (c *CertificateManager) Get(domain string) *types.Certificate
- func (c *CertificateManager) GetAll() map[string]*types.Certificate
- func (c *CertificateManager) Present(domain string, token string, auth string) error
- type Container
- func (o *Container) ApplyProject(ctx context.Context, opts *ApplyProjectOptions) ([]types.Service, error)
- func (o *Container) ApplyService(ctx context.Context, service types.Service, net *docker.Network) (*types.Service, error)
- func (o *Container) DoesProjectExist(name string) bool
- func (o *Container) FindAllProjects() map[string][]types.Service
- func (o *Container) GetProjectStatus(ctx context.Context, project string) (*Status, error)
- func (o *Container) IsProjectRunning(ctx context.Context, project string) bool
- func (o *Container) RemoveProject(ctx context.Context, project string) error
- type IngressManager
- func (i *IngressManager) Match(domain string) (*types.Ingress, error)
- func (i *IngressManager) RegisterRoute(ingress types.Ingress) error
- func (i *IngressManager) RemoveAllRoutes(project string) (int, error)
- func (i *IngressManager) RemoveUnusedRoutes(project string, excludedDomains []string) (int, error)
- type Status
Constants ¶
const ( StateNotAvailable = "not_available" StatusRunning = "running" StatusStopped = "stopped" )
const ( SourceDocker = "docker" SourceGit = "git" )
Variables ¶
var ( // LetsEncryptDirectoryUrl will point to the staging environment by default. LetsEncryptDirectoryUrl = lego.LEDirectoryStaging // InsecureDirectory informs the application that the ACME directory does not have valid TLS certificates. InsecureDirectory = false )
Functions ¶
This section is empty.
Types ¶
type ApplyProjectOptions ¶
type ApplyProjectOptions struct { ProjectName string `json:"project_name"` Services []struct { Name string `json:"name"` Source types.Source `json:"source"` Environment map[string]string `json:"environment"` IngressDomain string `json:"ingress_domain"` ContainerPort int `json:"container_port"` ChallengeType types.ChallengeType `json:"challenge_type"` Quota types.Quota `json:"quota"` } `json:"services"` }
type CertificateManager ¶
type CertificateManager struct {
// contains filtered or unexported fields
}
func NewCertificateManger ¶
func NewCertificateManger(database *db.Client, email string) *CertificateManager
func (*CertificateManager) Authorize ¶
func (c *CertificateManager) Authorize(domain string, token string) (string, error)
Authorize will return the authorization if available for the given domain.
func (*CertificateManager) ChallengeCreate ¶
func (c *CertificateManager) ChallengeCreate(domain string, challenge types.ChallengeType)
ChallengeCreate will create a new challenge request for the ingress domain.
func (*CertificateManager) CleanUp ¶
func (c *CertificateManager) CleanUp(domain string, token string, auth string) error
func (*CertificateManager) Get ¶
func (c *CertificateManager) Get(domain string) *types.Certificate
Get will retrieve the active certificate for the given domain if available. If no certificate is available it will return nil.
func (*CertificateManager) GetAll ¶
func (c *CertificateManager) GetAll() map[string]*types.Certificate
GetAll will retrieve all certificates currently known to the system.
type Container ¶
type Container struct { Database *db.Client Docker *docker.Client IngressManager *IngressManager // contains filtered or unexported fields }
func NewContainerManager ¶
func NewContainerManager() *Container
func (*Container) ApplyProject ¶
func (o *Container) ApplyProject(ctx context.Context, opts *ApplyProjectOptions) ([]types.Service, error)
ApplyProject will apply the configuration changes for the specified project. It will create the required resources and clean up the no longer referenced resources.
func (*Container) ApplyService ¶
func (o *Container) ApplyService(ctx context.Context, service types.Service, net *docker.Network) (*types.Service, error)
ApplyService will create the resources required for starting the service.
func (*Container) DoesProjectExist ¶
DoesProjectExist checks whether the project with the given name actually exists in the system.
func (*Container) FindAllProjects ¶
FindAllProjects will return all projects currently available.
func (*Container) GetProjectStatus ¶
func (*Container) IsProjectRunning ¶
IsProjectRunning will return true if all services within the project are running.
type IngressManager ¶
type IngressManager struct { Database *db.Client CertificateManager *CertificateManager // contains filtered or unexported fields }
func NewIngressManager ¶
func NewIngressManager() *IngressManager
func (*IngressManager) Match ¶
func (i *IngressManager) Match(domain string) (*types.Ingress, error)
Match will retrieve the ingress route information for the specified domain.
func (*IngressManager) RegisterRoute ¶
func (i *IngressManager) RegisterRoute(ingress types.Ingress) error
RegisterRoute will register a new ingress route and complete the necessary actions to make it ready for use.
func (*IngressManager) RemoveAllRoutes ¶
func (i *IngressManager) RemoveAllRoutes(project string) (int, error)
RemoveAllRoutes will remove all routes linked to the specified project.
func (*IngressManager) RemoveUnusedRoutes ¶
func (i *IngressManager) RemoveUnusedRoutes(project string, excludedDomains []string) (int, error)
RemoveUnusedRoutes will remove all unused routes related to the specified project.