traefik

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 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(_ context.Context, value string) certcrypto.KeyType

GetKeyType used to determine which algo to used.

Types

type Account

type Account struct {
	Email        string                 `json:"Account"`
	Registration *registration.Resource `json:"Registration"`
	PrivateKey   []byte                 `json:"PrivateKey"`
	KeyType      certcrypto.KeyType     `json:"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() []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 `json:"HTTPChallenges"`
	TLSChallenges  map[string]*Certificate      `json:"TLSChallenges"`
}

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