forklift

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package forklift provides the core functionality of the forklift tool

Index

Constants

View Source
const Timestamp = "20060102150405"

Variables

This section is empty.

Functions

func CompareCachedPkgs

func CompareCachedPkgs(p, q CachedPkg) int

func CompareCachedRepoPaths

func CompareCachedRepoPaths(r, s CachedRepo) int

func CompareCachedRepos

func CompareCachedRepos(r, s CachedRepo) int

func CompareVersionedRepos

func CompareVersionedRepos(r, s VersionedRepo) int

func DeplsFS

func DeplsFS(envFS fs.FS) (fs.FS, error)

func ShortCommit

func ShortCommit(commit string) string

func ToTimestamp

func ToTimestamp(t time.Time) string

func VersionedReposFS

func VersionedReposFS(envFS fs.FS) (fs.FS, error)

Types

type CachedPkg

type CachedPkg struct {
	Repo       CachedRepo
	Path       string
	PkgSubdir  string
	ConfigPath string
	Config     PkgConfig
}

func FindCachedPkg

func FindCachedPkg(cacheFS fs.FS, pkgPath string, version string) (CachedPkg, error)

func ListCachedPkgs

func ListCachedPkgs(cacheFS fs.FS, cachedPrefix string) ([]CachedPkg, error)

func ListVersionedPkgs

func ListVersionedPkgs(cacheFS fs.FS, repos []VersionedRepo) ([]CachedPkg, error)

type CachedRepo

type CachedRepo struct {
	VCSRepoPath string
	Version     string
	RepoSubdir  string
	ConfigPath  string
	Config      RepoConfig
}

func FindCachedRepo

func FindCachedRepo(cacheFS fs.FS, repoPath string, version string) (CachedRepo, error)

func ListCachedRepos

func ListCachedRepos(cacheFS fs.FS) ([]CachedRepo, error)

func LoadCachedRepo

func LoadCachedRepo(cacheFS fs.FS, repoConfigFilePath string) (CachedRepo, error)

func (CachedRepo) FromSameVCSRepo

func (r CachedRepo) FromSameVCSRepo(cr CachedRepo) bool

type Depl

type Depl struct {
	Name   string
	Config DeplConfig
	Pkg    VersionedPkg
}

func ListDepls

func ListDepls(envFS fs.FS, cacheFS fs.FS) ([]Depl, error)

func LoadDepl

func LoadDepl(envFS, cacheFS fs.FS, deplName string) (Depl, error)

func (*Depl) DisabledFeatures

func (d *Depl) DisabledFeatures(
	all map[string]PkgFeatureSpec,
) (disabled map[string]PkgFeatureSpec, err error)

func (*Depl) EnabledFeatures

func (d *Depl) EnabledFeatures(
	all map[string]PkgFeatureSpec,
) (enabled map[string]PkgFeatureSpec, err error)

type DeplConfig

type DeplConfig struct {
	Package  string   `yaml:"package"`
	Features []string `yaml:"features"`
}

type ListenerResource

type ListenerResource struct {
	Description string `yaml:"description"`
	Port        int    `yaml:"port"`
	Protocol    string `yaml:"protocol"`
}

type NetworkResource

type NetworkResource struct {
	Description string `yaml:"description"`
	Name        string `yaml:"name"`
}

type PkgConfig

type PkgConfig struct {
	Package    PkgSpec                   `yaml:"package"`
	Host       PkgHostSpec               `yaml:"host"`
	Deployment PkgDeplSpec               `yaml:"deployment"`
	Features   map[string]PkgFeatureSpec `yaml:"features"`
}

type PkgDeplSpec

type PkgDeplSpec struct {
	Name           string            `yaml:"name"`
	DefinitionFile string            `yaml:"definition-file"`
	Requires       RequiredResources `yaml:"requires"`
	Provides       ProvidedResources `yaml:"provides"`
}

func (PkgDeplSpec) DefinesStack

func (s PkgDeplSpec) DefinesStack() bool

type PkgFeatureSpec

type PkgFeatureSpec struct {
	Description string            `yaml:"description"`
	Requires    RequiredResources `yaml:"requires"`
	Provides    ProvidedResources `yaml:"provides"`
}

type PkgHostSpec

type PkgHostSpec struct {
	Provides ProvidedResources `yaml:"provides"`
}

type PkgMaintainer

type PkgMaintainer struct {
	Name  string `yaml:"name"`
	Email string `yaml:"email"`
}

type PkgSpec

type PkgSpec struct {
	Description string          `yaml:"description"`
	Maintainers []PkgMaintainer `yaml:"maintainers"`
	License     string          `yaml:"license"`
	LicenseFile string          `yaml:"license-file"`
	Sources     []string        `yaml:"sources"`
}

type ProvidedResources

type ProvidedResources struct {
	Listeners []ListenerResource `yaml:"listeners"`
	Networks  []NetworkResource  `yaml:"networks"`
	Services  []ServiceResource  `yaml:"services"`
}

type RepoConfig

type RepoConfig struct {
	Repository RepoSpec `yaml:"repository"`
}

type RepoSpec

type RepoSpec struct {
	Path        string `yaml:"path"`
	Description string `yaml:"description"`
}

type RepoVersionConfig

type RepoVersionConfig struct {
	Release string `yaml:"release"`
}

type RepoVersionLock

type RepoVersionLock struct {
	Version   string `yaml:"version"`
	Timestamp string `yaml:"timestamp"`
	Commit    string `yaml:"commit"`
}

func (RepoVersionLock) IsCommitLocked

func (l RepoVersionLock) IsCommitLocked() bool

func (RepoVersionLock) IsVersion

func (l RepoVersionLock) IsVersion() bool

func (RepoVersionLock) ParseVersion

func (l RepoVersionLock) ParseVersion() (semver.Version, error)

func (RepoVersionLock) Pseudoversion

func (l RepoVersionLock) Pseudoversion() (string, error)

func (RepoVersionLock) ShortCommit

func (l RepoVersionLock) ShortCommit() string

type RequiredResources

type RequiredResources struct {
	Networks []NetworkResource `yaml:"networks"`
	Services []ServiceResource `yaml:"services"`
}

type ServiceResource

type ServiceResource struct {
	Description string   `yaml:"description"`
	Tags        []string `yaml:"tags"`
	Port        int      `yaml:"port"`
	Protocol    string   `yaml:"protocol"`
	Paths       []string `yaml:"paths"`
}

type VersionedPkg

type VersionedPkg struct {
	Path   string
	Repo   VersionedRepo
	Cached CachedPkg
}

func LoadVersionedPkg

func LoadVersionedPkg(reposFS, cacheFS fs.FS, pkgPath string) (VersionedPkg, error)

type VersionedRepo

type VersionedRepo struct {
	VCSRepoPath string
	RepoSubdir  string
	Config      RepoVersionConfig
	Lock        RepoVersionLock
}

func ListVersionedRepos

func ListVersionedRepos(envFS fs.FS) ([]VersionedRepo, error)

func LoadVersionedRepo

func LoadVersionedRepo(reposFS fs.FS, repoPath string) (VersionedRepo, error)

func (VersionedRepo) Path

func (r VersionedRepo) Path() string

func (VersionedRepo) Version

func (r VersionedRepo) Version() (string, error)

Directories

Path Synopsis
Package workspace handles forklift workspace operations
Package workspace handles forklift workspace operations

Jump to

Keyboard shortcuts

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