model

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: Apache-2.0 Imports: 13 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")
	// ErrorMissingOwner indicates that the owner is not found
	ErrorMissingOwner = errors.New("owner not found")
	// ErrorWrongSignature indicates that the signature is not correct
	ErrorWrongSignature = errors.New("invalid signature")
	// ErrorWrongChecksum indicates that the checksum of tar file is not correct
	ErrorWrongChecksum = errors.New("checksum mismatch")
	// ErrorWrongFileName indicates that the name of tar file is not correct
	ErrorWrongFileName = errors.New("incorrect file name")
	// ErrorWrongManifestType indicates that the manifest type is not expected
	ErrorWrongManifestType = errors.New("the manifest type is not expected")
	// ErrorWrongManifestVersion indicates that the manifest version is not expected
	ErrorWrongManifestVersion = errors.New("the manifest version is not expected")
)

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// Publish push a new component to mirror or modify an exists component
	Publish(manifest *v1manifest.Manifest, info ComponentInfo) error
	// Introduce add a new owner to mirror
	Grant(id, name string, key *v1manifest.KeyInfo) error
	// Rotate update root manifest
	Rotate(manifest *v1manifest.Manifest) error
}

Backend defines operations on the manifests

func New

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

New returns a object implemented Backend

type ComponentData

type ComponentData interface {
	io.Reader

	// Filename is the name of tarbal
	Filename() string
}

ComponentData is used to represent the tarbal

type ComponentInfo

type ComponentInfo interface {
	ComponentData

	Standalone() *bool
	Yanked() *bool
	Hidden() *bool
}

ComponentInfo is used to update component

type PublishInfo

type PublishInfo struct {
	ComponentData
	Stand *bool
	Yank  *bool
	Hide  *bool
}

PublishInfo implements ComponentInfo

func (*PublishInfo) Filename

func (i *PublishInfo) Filename() string

Filename implements ComponentData

func (*PublishInfo) Hidden

func (i *PublishInfo) Hidden() *bool

Hidden implements ComponentInfo

func (*PublishInfo) Standalone

func (i *PublishInfo) Standalone() *bool

Standalone implements ComponentInfo

func (*PublishInfo) Yanked

func (i *PublishInfo) Yanked() *bool

Yanked implements ComponentInfo

type TarInfo

type TarInfo struct {
	io.Reader
	Name string
}

TarInfo implements ComponentData

func (*TarInfo) Filename

func (ti *TarInfo) Filename() string

Filename implements ComponentData

Jump to

Keyboard shortcuts

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