trust

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: BSD-2-Clause Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPolicy = errors.New("invalid policy")

Functions

This section is empty.

Types

type Policy added in v0.1.0

type Policy struct {
	SignatureThreshold int               `json:"ospkg_signature_threshold"`
	FetchMethod        ospkg.FetchMethod `json:"ospkg_fetch_method"`
}

Policy holds security configuration.

func NewPolicy added in v0.1.0

func NewPolicy(template Policy) (Policy, error)

NewPolicy creates a Policy from template. If the template is not a valid Policy, the returned error wrapps ErrInvalidPolicy.

func (*Policy) UnmarshalJSON added in v0.1.0

func (p *Policy) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It initializes p from a JSON data byte stream. If unmarshaling fails, a json.UnmarshalTypeError is returned. In case of further inter-field invalidities or other rules, that are not met, the reurned error wrapps ErrInvalidPolicy.

Jump to

Keyboard shortcuts

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