resources

package
v0.0.0-...-d0717c5 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RepoFile = "kerria.repo.yaml"
	RepoKind = "Repository"
)

Variables

View Source
var (
	HashAlgorithms = map[string]HashAlgorithm{
		"md5":    MD5,
		"sha1":   SHA1,
		"sha256": SHA256,
		"sha512": SHA512,
	}
	HashAlgorithmsReverse map[HashAlgorithm]string
)
View Source
var (
	ProcessorStages = map[string]ProcessorStage{
		"None":      StageNone,
		"PreBuild":  StagePreBuild,
		"PostBuild": StagePostBuild,
	}
	ProcessorStagesReverse map[ProcessorStage]string
)

Functions

func Hasher

func Hasher(algorithm HashAlgorithm) (hash.Hash, error)

Types

type BuildStatus

type BuildStatus struct {
	ID            int
	Timestamp     time.Time
	DiscoHash     []byte
	DiscoHashType HashAlgorithm
	DiscoPath     string
	BuildHash     []byte
	BuildHashType HashAlgorithm
	BuildPath     string
}

type Discovery

type Discovery struct {
	Path        string
	Name        string
	Namespace   string
	Labels      map[string]string
	Annotations map[string]string
}

type HashAlgorithm

type HashAlgorithm int
const (
	MD5 HashAlgorithm = iota
	SHA1
	SHA256
	SHA512

	LockFile = "kerria.lock.yaml"
	LockKind = "Lockfile"
)

type Lockfile

type Lockfile struct {
	Name        string
	DefaultHash HashAlgorithm
	Builds      []*BuildStatus
}

func LockfileFromAPI

func LockfileFromAPI(apiLock *v1alpha1.Lockfile) (*Lockfile, error)

LockfileFromAPI converts the latest API into the internal representation

func ReadLockfile

func ReadLockfile() (*Lockfile, error)

func ReadLockfileWithPath

func ReadLockfileWithPath(path string) (*Lockfile, error)

func (*Lockfile) AsAPI

func (lockfile *Lockfile) AsAPI() *v1alpha1.Lockfile

func (*Lockfile) Write

func (lockfile *Lockfile) Write() error

func (*Lockfile) WriteWithPath

func (lockfile *Lockfile) WriteWithPath(path string) error

type Processor

type Processor struct {
	ID            int
	Name          string
	Stage         ProcessorStage
	Properties    interface{}
	Image         string
	Network       bool
	StorageMounts []*StorageMount
	Env           []string
}

type ProcessorStage

type ProcessorStage int
const (
	StageNone ProcessorStage = iota
	StagePreBuild
	StagePostBuild
)

type Repository

type Repository struct {
	Name           string
	GitRoot        string
	RepoRoot       string
	KustomizeFlags []string
	BuildPath      string
	Sources        []*Source
	Processors     []*Processor
}

func ReadRepository

func ReadRepository() (*Repository, error)

func ReadRepositoryWithPath

func ReadRepositoryWithPath(path string) (*Repository, error)

func RepositoryFromAPI

func RepositoryFromAPI(apiRepo *v1alpha1.Repository) (*Repository, error)

RepositoryFromAPI converts the latest API into the internal representation

type Source

type Source struct {
	ID          int
	Name        string
	Discoveries []*Discovery
}

type StorageMount

type StorageMount struct {
	MountType     string
	Source        string
	Destination   string
	ReadWriteMode bool
}

Jump to

Keyboard shortcuts

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