opts

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ErrNonNil = Error("")

ErrNonNil is used for testing.

View Source
const OptsVersion int = 0

OptsVersion is the Version of Opts. It can be used for validation.

Variables

View Source
var (
	ErrNoSrcProvided         = errors.New("no/empty source provided")
	ErrMultipleSigningCerts  = errors.New("exactly one root certificate is expected")
	ErrMissingHTTPSRootCerts = errors.New("missing HTTPS root certificate(s)")
	ErrNoCertificateFound    = errors.New("no certifiates found")
)

Functions

This section is empty.

Types

type Error

type Error string

Error reports problems while lodasing and validating configuration data.

func (Error) Error

func (e Error) Error() string

Error implements error interface.

type Loader

type Loader func(*Opts) error

Loader modifys the provided *Opts instance.

func WithHTTPSRootCerts

func WithHTTPSRootCerts(reader io.Reader) Loader

func WithHostCfg

func WithHostCfg(reader io.Reader) Loader

func WithSigningRootCert

func WithSigningRootCert(reader io.Reader) Loader

func WithTrustPolicy added in v0.1.0

func WithTrustPolicy(reader io.Reader) Loader

type Opts

type Opts struct {
	Version     int
	TrustPolicy trust.Policy
	HostCfg     host.Config
	SigningRoot *x509.Certificate
	HTTPSRoots  []*x509.Certificate
}

Opts controls the operation of stboot.

func NewOpts

func NewOpts(loaders ...Loader) (*Opts, error)

NewOpts return a new Opts initialized by the provided Loaders.

Jump to

Keyboard shortcuts

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