artifact

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MaxGoroutines = 8 // used by other packages that query components from external sources

Variables

This section is empty.

Functions

func AuthenticateDependencies

func AuthenticateDependencies(
	lcUser *api.LcUser,
	signerID string,
	deps []Dependency,
	batchSize int,
	progressCallback func([]Dependency),
) ([]error, error)

AuthenticateDependencies ...

func Display

func Display(a Artifact, columns ColumnID)

func HashTypeName

func HashTypeName(hashType HashType) string

func NotarizeDependencies

func NotarizeDependencies(
	lcUser *api.LcUser,
	kinds []string,
	deps []*Dependency,
	batchSize int,
	progressCallback func([]*Dependency),
) error

NotarizeDependencies ...

func ToApiArtifact

func ToApiArtifact(kind, name, version, hash string, hashType HashType) *api.Artifact

ToApiArtifact ...

func TrustLevelName

func TrustLevelName(level TrustLevel) string

Types

type Artifact

type Artifact interface {
	Path() string
	Type() string
	Dependencies() []Dependency
	ResolveDependencies(output OutputOptions) ([]Dependency, error)
}

Artifact is a result of build process. It is a language- and/or environment-specific interface which finds dependencies

type ColumnID

type ColumnID uint
const (
	ColNameVersion ColumnID = 1 << iota
	ColHash
	ColTrustLevel
	MaxColumn = iota
)

type DepType

type DepType bool
const (
	DepDirect    DepType = false
	DepTransient DepType = true
)

type Dependency

type Dependency struct {
	Name       string
	Version    string
	Hash       string
	Kind       string
	HashType   HashType
	TrustLevel TrustLevel // set by Notorize/Authenticate
	SignerID   string     // set by Notorize/Authenticate
	License    string
	Timestamp  time.Time
	Type       DepType
}

Dependency is a single building block, used for building the Artifact

type GenericArtifact

type GenericArtifact struct {
	Deps []Dependency
}

func (GenericArtifact) Dependencies

func (a GenericArtifact) Dependencies() []Dependency

type HashType

type HashType uint
const (
	HashInvalid HashType = iota
	HashSHA1
	HashSHA224
	HashSHA256
	HashSHA384
	HashSHA512
	HashMD2
	HashMD4
	HashMD5
	HashMD6
)

func HashTypeByName

func HashTypeByName(text string) HashType

type LoadedArtifact

type LoadedArtifact struct {
	GenericArtifact
	// contains filtered or unexported fields
}

func LoadFromDb

func LoadFromDb(hash string, signerID string, lcUser *api.LcUser) (*LoadedArtifact, error)

func (LoadedArtifact) Dependencies

func (a LoadedArtifact) Dependencies() []Dependency

func (LoadedArtifact) Path

func (a LoadedArtifact) Path() string

func (LoadedArtifact) ResolveDependencies

func (a LoadedArtifact) ResolveDependencies(output OutputOptions) ([]Dependency, error)

func (LoadedArtifact) Type

func (a LoadedArtifact) Type() string

type OutputOptions

type OutputOptions uint
const (
	Silent OutputOptions = iota
	Progress
)

type TrustLevel

type TrustLevel uint
const (
	Invalid TrustLevel = iota
	Untrusted
	Unsupported
	Unknown
	Trusted
	MinTrustLevel = Untrusted
	MaxTrustLevel = Trusted
)

Jump to

Keyboard shortcuts

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