manager

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateNotAvailable = "not_available"
	StatusRunning     = "running"
	StatusStopped     = "stopped"
)
View Source
const (
	SourceDocker = "docker"
	SourceGit    = "git"
)

Variables

View Source
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(ingress types.Ingress)

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.

func (*CertificateManager) Present

func (c *CertificateManager) Present(domain string, token string, auth string) error

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

func (o *Container) DoesProjectExist(name string) bool

DoesProjectExist checks whether the project with the given name actually exists in the system.

func (*Container) FindAllProjects

func (o *Container) FindAllProjects() map[string][]types.Service

FindAllProjects will return all projects currently available.

func (*Container) GetProjectStatus

func (o *Container) GetProjectStatus(ctx context.Context, project string) (*Status, error)

func (*Container) IsProjectRunning

func (o *Container) IsProjectRunning(ctx context.Context, project string) bool

IsProjectRunning will return true if all services within the project are running.

func (*Container) RemoveProject

func (o *Container) RemoveProject(ctx context.Context, project string) error

RemoveProject will remove the resources associated to the project.

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.

type Status

type Status struct {
	Service []types.Service
	// contains filtered or unexported fields
}

func (*Status) GetState

func (s *Status) GetState(service string) string

GetState retrieves the current state of the service.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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