legos

package
v0.0.0-...-365c88f Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CADirURL           = lego.LEDirectoryProduction
	DefaultCertTimeout = 30
)

Functions

func CopyFile

func CopyFile(content []byte, path string) error

func CreateNonExistingFolder

func CreateNonExistingFolder(path string) error

func LegoClient

func LegoClient(email string) (storage *AccountsStorage, account *Account, client *lego.Client, err error)

func ObtainCertificate

func ObtainCertificate(client *lego.Client, domains []string) (*certificate.Resource, error)

func SetDNSChallenge

func SetDNSChallenge(client *lego.Client, challenge DNSChallenge) error

func SetWebRootChallenge

func SetWebRootChallenge(client *lego.Client, webRootPath string) error

Types

type Account

type Account struct {
	Email        string                 `json:"email"`
	Registration *registration.Resource `json:"registration"`
	Key          crypto.PrivateKey      `json:"-"`
}

Account represents a users local saved credentials.

func (*Account) GetEmail

func (a *Account) GetEmail() string

GetEmail returns the email address for the account.

func (*Account) GetPrivateKey

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

GetPrivateKey returns the private RSA account key.

func (*Account) GetRegistration

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

GetRegistration returns the server registration.

type AccountsStorage

type AccountsStorage struct {
	Email    string
	CADirURL string
	// contains filtered or unexported fields
}

func NewAccountsStorage

func NewAccountsStorage(email, CADirURL string) (*AccountsStorage, error)

NewAccountsStorage Creates a new AccountsStorage.

func (*AccountsStorage) LoadAccount

func (s *AccountsStorage) LoadAccount() (*Account, error)

func (*AccountsStorage) Remove

func (s *AccountsStorage) Remove()

func (*AccountsStorage) Save

func (s *AccountsStorage) Save(account *Account) error

type DNSChallenge

type DNSChallenge struct {
	Name                  string
	Servers               string
	DisableCP             bool
	PropagationDisableANS bool
	PropagationWait       int
	PropagationRNS        bool
	Timeout               int
}

Jump to

Keyboard shortcuts

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