model

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrorConflict indicates manifest conflict
	ErrorConflict = errors.New("manifest conflict")
	// ErrorMissingKey indicates that the private key is missing
	ErrorMissingKey = errors.New("the private key is missing")
)

Functions

This section is empty.

Types

type ComponentManifest

type ComponentManifest struct {
	// Signatures value
	Signatures []v1manifest.Signature `json:"signatures"`
	// Signed value; any value here must have the SignedBase base.
	Signed v1manifest.Component `json:"signed"`
}

ComponentManifest represents xxx.json

type IndexManifest

type IndexManifest struct {
	// Signatures value
	Signatures []v1manifest.Signature `json:"signatures"`
	// Signed value; any value here must have the SignedBase base.
	Signed v1manifest.Index `json:"signed"`
}

IndexManifest represents index.json

func (*IndexManifest) KeyOwner added in v1.0.5

func (m *IndexManifest) KeyOwner(keyid string) (string, *v1manifest.Owner)

KeyOwner returns the owner or nil for a given keyid

type Model

type Model interface {
	UpdateComponentManifest(component string, manifest *ComponentManifest) error
	UpdateRootManifest(manifest *RootManifest) error
	UpdateIndexManifest(time.Time, func(*IndexManifest) *IndexManifest) error
	UpdateSnapshotManifest(time.Time, func(*SnapshotManifest) *SnapshotManifest) error
	UpdateTimestampManifest(time.Time) error
}

Model defines operations on the manifests

func New

func New(txn store.FsTxn, keys map[string]*v1manifest.KeyInfo) Model

New returns a object implemented Model

type RootManifest

type RootManifest struct {
	// Signatures value
	Signatures []v1manifest.Signature `json:"signatures"`
	// Signed value; any value here must have the SignedBase base.
	Signed v1manifest.Root `json:"signed"`
}

RootManifest represents root.json

type SnapshotManifest

type SnapshotManifest struct {
	// Signatures value
	Signatures []v1manifest.Signature `json:"signatures"`
	// Signed value; any value here must have the SignedBase base.
	Signed v1manifest.Snapshot `json:"signed"`
}

SnapshotManifest represents snapshot.json

type TimestampManifest

type TimestampManifest struct {
	// Signatures value
	Signatures []v1manifest.Signature `json:"signatures"`
	// Signed value; any value here must have the SignedBase base.
	Signed v1manifest.Timestamp `json:"signed"`
}

TimestampManifest represents timestamp.json

Jump to

Keyboard shortcuts

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