client

package
Version: v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JobQueue = make(chan CertReq, 10)

JobQueue holds all active jobs

Functions

func CertWorker

func CertWorker(id int, client api.CertificateIssuerClient, storage *CertStorage)

CertWorker is the actual worker routine that eats away from the queue

func IsJobsStopped

func IsJobsStopped(jobs []Job) bool

IsJobsStopped determines whether all jobs supplied is stopped or not

func StartClient

func StartClient(config *config.ClientConfig, userAgent string)

StartClient starts a client instance with a client config and a user agent

Types

type CertReq

type CertReq struct {
	DNSName  string
	Renewal  bool
	Attempts int
}

CertReq represents a certificate request

func NewCertReq

func NewCertReq(dnsName string, renewal bool) CertReq

NewCertReq constructs an instance of the CertReq struct

func (*CertReq) Submit

func (r *CertReq) Submit()

Submit a job to the queue for processing

type CertStorage

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

CertStorage represents where the certificates is stored at the client side

func NewCertStorage

func NewCertStorage(storageDirectory string) *CertStorage

NewCertStorage constructs an instance of the CertStorage struct, with validation

func (*CertStorage) LocallyStoredDomains

func (c *CertStorage) LocallyStoredDomains() ([]string, error)

LocallyStoredDomains lists all domain names that has TLS certificates stored

func (*CertStorage) Store

func (c *CertStorage) Store(domain string, response *api.CertificateResponse) error

Store certificates for a given API response and domain

type Job

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

Job is a container for a repeating execution of a function.

A Job executes it's function continuously with a predefined delay between executions. The Job only stops when the `Stop` function is called.

func Register

func Register(f func(), name string, delay time.Duration, runImmediately bool) *Job

Register schedules a function for execution, to be invoked repeated with a delay of the value of i.

If the runImmediately parameter is true, the function will execute immediately. Otherwise, it will be invoked first after the duration of i.

func (*Job) Stop

func (j *Job) Stop()

Stop halts the execution of the Job's function.

Jump to

Keyboard shortcuts

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