Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Close() error
- func (c *Client) GetAllCertificates() map[string]*types.Certificate
- func (c *Client) GetAllProjects() map[string][]types.Service
- func (c *Client) GetCertificate(domain string) (*types.Certificate, error)
- func (c *Client) GetDomainChallenge(domain string) *types.AcmeChallenge
- func (c *Client) GetIngressRoute(domain string) (*types.Ingress, error)
- func (c *Client) GetIngressRoutesByProject(project string) []types.Ingress
- func (c *Client) GetServicesForProject(project string) []types.Service
- func (c *Client) RemoveAcmeChallenge(domain string, token string, auth string) error
- func (c *Client) RemoveCertificate(domain string) error
- func (c *Client) RemoveIngressRoute(domain string) error
- func (c *Client) RemoveProject(name string) error
- func (c *Client) SaveIngressRoute(route *types.Ingress) error
- func (c *Client) SaveProject(project string, services []types.Service) error
- func (c *Client) SetAcmeChallenge(domain string, token string, auth string) error
- func (c *Client) SetCertificate(domain string, cert *types.Certificate) error
- type Config
- func (c *Config) ClearAcme()
- func (c *Config) GetAcmeEmail() string
- func (c *Config) GetAcmePrivateKey() crypto.PrivateKey
- func (c *Config) GetAcmeRegistration() *registration.Resource
- func (c *Config) SetAcmeEmail(email string)
- func (c *Config) SetAcmePrivateKey(privateKey crypto.PrivateKey)
- func (c *Config) SetAcmeRegistration(registration *registration.Resource)
Constants ¶
const ( DataDirectory = "/var/lib/conter" DataFileName = "app.db" )
Variables ¶
var ( BucketProjects = []byte("projects") BucketRoutes = []byte("routes") BucketConfig = []byte("config") BucketChallenges = []byte("challenges") BucketCertificates = []byte("certificates") ErrItemNotFound = errors.New("item not found") )
var ( KeyAcmeEmail = []byte("acme.email") KeyAcmePrivateKey = []byte("acme.private_key") KeyAcmeRegistration = []byte("acme.registration") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client acts as the interface between to communicate with our database system.
func NewClient ¶
func NewClient() *Client
NewClient will create a new database client for handling operations.
func (*Client) GetAllCertificates ¶
func (c *Client) GetAllCertificates() map[string]*types.Certificate
GetAllCertificates will return all certificates with the key being the domain name.
func (*Client) GetAllProjects ¶
GetAllProjects will return a map of all projects known by the system in combination with their services.
func (*Client) GetCertificate ¶
func (c *Client) GetCertificate(domain string) (*types.Certificate, error)
GetCertificate retrieves the certificate for the specified domain.
func (*Client) GetDomainChallenge ¶
func (c *Client) GetDomainChallenge(domain string) *types.AcmeChallenge
GetDomainChallenge will return the latest known ACME challenge. If no challenge exists it will return nil.
func (*Client) GetIngressRoute ¶
GetIngressRoute will return the ingress route if it exists.
func (*Client) GetIngressRoutesByProject ¶
GetIngressRoutesByProject returns all ingress routes related to the project.
func (*Client) GetServicesForProject ¶
GetServicesForProject will return the services associated for the project. If no services are available or the project does not exist it will return nil.
func (*Client) RemoveAcmeChallenge ¶
RemoveAcmeChallenge will remove the ACME challenge if all parameters match.
func (*Client) RemoveCertificate ¶
RemoveCertificate removes the certificate from the bucket.
func (*Client) RemoveIngressRoute ¶
func (*Client) RemoveProject ¶
RemoveProject will remove the project from the database.
func (*Client) SaveProject ¶
SaveProject will persist the project in the database.
func (*Client) SetAcmeChallenge ¶
SetAcmeChallenge will persist the ACME challenge for validating a certificate request.
func (*Client) SetCertificate ¶
func (c *Client) SetCertificate(domain string, cert *types.Certificate) error
SetCertificate persists the certificate configuration for the domain.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func NewConfigDatabase ¶
NewConfigDatabase creates a new database that only interacts with the configuration bucket.
func (*Config) GetAcmeEmail ¶
GetAcmeEmail will return the email address of the ACME user.
func (*Config) GetAcmePrivateKey ¶
func (c *Config) GetAcmePrivateKey() crypto.PrivateKey
GetAcmePrivateKey will return the private key used to register the user via ACME.
func (*Config) GetAcmeRegistration ¶
func (c *Config) GetAcmeRegistration() *registration.Resource
GetAcmeRegistration will return the registration resource we got from the ACME authority.
func (*Config) SetAcmeEmail ¶
SetAcmeEmail will configure the ACME user email.
func (*Config) SetAcmePrivateKey ¶
func (c *Config) SetAcmePrivateKey(privateKey crypto.PrivateKey)
SetAcmePrivateKey will persist the ACME private key into the configuration bucket.
func (*Config) SetAcmeRegistration ¶
func (c *Config) SetAcmeRegistration(registration *registration.Resource)
SetAcmeRegistration will persist the registration resources we got from the ACME authority.