internal

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSumWithGitIgnoreWithRelative

func CheckSumWithGitIgnoreWithRelative(projectRoot *string, relativePath *string, inputs []string, useGitIgnore bool) (*string, error)

func GetGitHashes

func GetGitHashes(projectRoot *string, relativePath *string, inputs []string) (*[]string, error)

func Int

func Int(s int) *int

func MD5All

func MD5All(root string, shouldIgnoreFn func(string) bool) (map[string][md5.Size]byte, error)

func MD5Dir

func MD5Dir(root string, shouldIgnoreFn func(string) bool) (*string, error)

func String

func String(s string) *string

Types

type Cache

type Cache struct {
	Inputs  []string `yaml:"inputs"`
	Outputs []string `yaml:"outputs"`
}

type CacheIndex

type CacheIndex struct {
	Hashes    map[string]string
	GitHashes map[string]string
}

Probably change this interface

type CacheLocation

type CacheLocation struct {
	RootDir   *string
	WorkDir   *string
	Locations []string
}

type CacheProvider

type CacheProvider interface {
	GetIndex() (CacheIndex, error)
	PutIndex(CacheIndex) error
	GetCache(string, CacheLocation) error
	PutCache(CacheLocation) error
}

Probably change this interface

type CacheState

type CacheState struct {
	RootDir     *string
	WorkDir     *string
	Cache       Cache
	InChecksum  string
	GitRevs     []string
	OutChecksum *string
}

func (*CacheState) Inputs

func (state *CacheState) Inputs() CacheLocation

func (*CacheState) Outputs

func (state *CacheState) Outputs() CacheLocation

type Config

type Config struct {
	Targets        []Target        `yaml:"targets"`
	ExecutionPlans []ExecutionPlan `yaml:"execution_plans"`
}

func LoadConfig

func LoadConfig(filename string, log Log) (*Config, error)

type ExecutionPlan

type ExecutionPlan struct {
	Name    string   `yaml:"name"`
	Targets []string `yaml:"targets"`
}

type Log

type Log interface {
	Println(a ...interface{}) (n int, err error)
	Printf(format string, a ...interface{}) (n int, err error)
}

We provide a Log interface, so we can achieve two goals: * Make sure our tests are not noisy * Potentiall introduce file logging at a later time as a configurable option

type NoLog

type NoLog struct{}

func (NoLog) Printf

func (log NoLog) Printf(format string, a ...interface{}) (n int, err error)

func (NoLog) Println

func (log NoLog) Println(a ...interface{}) (n int, err error)

type OSLog

type OSLog struct{}

func (OSLog) Printf

func (log OSLog) Printf(format string, a ...interface{}) (n int, err error)

func (OSLog) Println

func (log OSLog) Println(a ...interface{}) (n int, err error)

type Target

type Target struct {
	Name       string    `yaml:"name"`
	MaxRetries *int      `yaml:"max_retries"`
	WorkDir    *string   `yaml:"work_dir"`
	Run        string    `yaml:"run"`
	DependsOn  *[]string `yaml:"depends_on"`
	Caches     *[]Cache  `yaml:"caches"`
}

func GetTargetsForPlan

func GetTargetsForPlan(config *Config, planName string, log Log) ([]Target, error)

type TargetResult

type TargetResult struct {
	Err     *error
	Target  Target
	Wait    *time.Duration
	Elapsed time.Duration
}

func RunPlan

func RunPlan(targets []Target, log Log) ([]TargetResult, error)

Jump to

Keyboard shortcuts

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