dir

package
v0.12.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 6 Imported by: 18

Documentation

Index

Constants

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

	// LocalCertificateExtension defines the extension of the certificate files
	LocalCertificateExtension = ".crt"

	// LocalKeyExtension defines the extension of the key files
	LocalKeyExtension = ".key"

	// LocalKeysDir is the directory name for local key store
	LocalKeysDir = "localkeys"

	// SignatureExtension defines the extension of the signature files
	SignatureExtension = ".sig"

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

	// SigningKeysFile is the file name of signing key info
	SigningKeysFile = "signingkeys.json"

	// TrustPolicyFile is the file name of trust policy info
	TrustPolicyFile = "trustpolicy.json"

	// TrustStoreDir is the directory name of trust store
	TrustStoreDir = "truststore"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PathManager

type PathManager struct {
	ConfigFS     UnionDirFS
	LibexecFS    UnionDirFS
	UserConfigFS UnionDirFS
}

PathManager contains the union directory file system and methods to access paths of notation

var (

	// Path is a PathManager pointer
	Path *PathManager
)

func (*PathManager) Config

func (p *PathManager) Config() string

Config returns the path of config.json

func (*PathManager) Localkey

func (p *PathManager) Localkey(name string) (keyPath, certPath string)

LocalKey returns path of the local private key and it's certificate in the localkeys directory

func (*PathManager) SigningKeyConfig

func (p *PathManager) SigningKeyConfig() string

SigningKeyConfig return the path of signingkeys.json files

func (*PathManager) TrustPolicy

func (p *PathManager) TrustPolicy() string

TrustPolicy returns the path of trustpolicy.json file

func (*PathManager) X509TrustStore

func (p *PathManager) X509TrustStore(prefix, namedStore string) string

X509TrustStore returns the path of x509 trust store certificate

type RootedFS

type RootedFS interface {
	fs.FS
	// Root returns the root path of the RootedFS
	Root() string
}

RootedFS is a file system interface supporting for getting root path.

func NewRootedFS

func NewRootedFS(root string, fsys fs.FS) RootedFS

NewRootedFS create a rootedFS

if fsys is nil, uses os.DirFS

type UnionDirFS

type UnionDirFS interface {
	fs.ReadDirFS
	// GetPath returns the path of the named file or directory under the FS
	GetPath(elem ...string) (string, error)
}

UnionDirFS is a simple union directory file system interface

func NewUnionDirFS

func NewUnionDirFS(rootedFsys ...RootedFS) UnionDirFS

NewUnionDirFS create an unionDirFS by rootedFS

func PluginFS

func PluginFS(dirs ...string) UnionDirFS

PluginFS returns the UnionDirFS for notation plugins if dirs is set, use dirs as the directories for plugins if dirs is not set, use build-in directory structure for plugins

Jump to

Keyboard shortcuts

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