traefik

package
v0.0.0-...-9ea8cef Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package traefik handles reading and parsing acme.json files from Traefik.

Index

Constants

This section is empty.

Variables

View Source
var ErrCertificateResolverNotFound = errors.New("certificate resolver not found")

ErrCertificateResolverNotFound is returned when the specified certificate resolver is not found.

Functions

func GetKeyType

func GetKeyType(ctx context.Context, value string) certcrypto.KeyType

GetKeyType used to determine which algo to used.

Types

type Account

type Account struct {
	Email        string
	Registration *registration.Resource
	PrivateKey   []byte
	KeyType      certcrypto.KeyType
}

Account is used to store lets encrypt registration info.

func (*Account) GetEmail

func (a *Account) GetEmail() string

GetEmail returns email.

func (*Account) GetPrivateKey

func (a *Account) GetPrivateKey() crypto.PrivateKey

GetPrivateKey returns private key.

func (*Account) GetRegistration

func (a *Account) GetRegistration() *registration.Resource

GetRegistration returns lets encrypt registration resource.

type Certificate

type Certificate struct {
	Domain      Domain `json:"domain"`
	Certificate []byte `json:"certificate"`
	Key         []byte `json:"key"`
}

Certificate is a struct which contains all data needed from an ACME certificate.

type Domain

type Domain struct {
	Main string
	SANs []string
}

Domain holds a domain name with SANs.

func (*Domain) Contains

func (d *Domain) Contains(domain string) bool

Contains returns true if a specified domain is in the Domain object.

func (*Domain) Set

func (d *Domain) Set(domains []string)

Set sets a domains from an array of strings.

func (*Domain) ToStrArray

func (d *Domain) ToStrArray() (domains []string)

ToStrArray convert a domain into an array of strings.

type LocalNamedStore

type LocalNamedStore struct {
	// Acme           *LocalStore    `json:"acme"`
	Account        *Account       `json:"Account"`
	Certificates   []*Certificate `json:"Certificates"`
	HTTPChallenges map[string]map[string][]byte
	TLSChallenges  map[string]*Certificate
}

LocalNamedStore represents the data managed by the Store.

func ReadBytes

func ReadBytes(data []byte, certificateResolver string) (*LocalNamedStore, error)

ReadBytes returns new LocalNamedStore from a byte slice.

func ReadFile

func ReadFile(filename, certificateResolver string) (*LocalNamedStore, error)

ReadFile returns new LocalNamedStore from a filename.

func (*LocalNamedStore) GetAccount

func (s *LocalNamedStore) GetAccount() *Account

GetAccount returns ACME Account.

func (*LocalNamedStore) GetCertificateByName

func (s *LocalNamedStore) GetCertificateByName(name string) *Certificate

GetCertificateByName returns ACME Certificate matching supplied name.

func (*LocalNamedStore) GetCertificates

func (s *LocalNamedStore) GetCertificates() []*Certificate

GetCertificates returns ACME Certificates list.

type LocalStore

type LocalStore map[string]*LocalNamedStore

LocalStore represents the parent store.

Jump to

Keyboard shortcuts

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