config

package
v0.0.0-...-48dca27 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FileName is the name of config file
	FileName = "nv2.json"

	// SignatureStoreDirName is the name of the signature store directory
	SignatureStoreDirName = "nv2"

	// SignatureExtension defines the extension of the signature files
	SignatureExtension = ".jwt"
)

Variables

View Source
var (
	// FilePath is the path of config file
	FilePath = filepath.Join(config.Dir(), FileName)
	// SignatureStoreDirPath is the path of the signature store
	SignatureStoreDirPath = filepath.Join(config.Dir(), SignatureStoreDirName)
)
View Source
var ErrNotaryDisabled = errors.New("notary disabled")

ErrNotaryDisabled indicates that notary is disabled

Functions

func CheckNotaryEnabled

func CheckNotaryEnabled() error

CheckNotaryEnabled checks the config file whether notary is enabled or not.

func IsRegistryInsecure

func IsRegistryInsecure(target string) bool

IsRegistryInsecure checks whether the registry is in the list of insecure registries.

func SignaturePath

func SignaturePath(manifestDigest digest.Digest) string

SignaturePath returns the path of a signature for a manifest

Types

type File

type File struct {
	Enabled            bool     `json:"enabled"`
	VerificationCerts  []string `json:"verificationCerts"`
	InsecureRegistries []string `json:"insecureRegistries"`
}

File reflects the config file

func Load

func Load() (*File, error)

Load reads the config from file

func New

func New() *File

New creates a new config file

func (*File) Save

func (f *File) Save() error

Save stores the config to file

Jump to

Keyboard shortcuts

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