Documentation ¶
Index ¶
- Constants
- Variables
- func CompareEtag(a, b string) bool
- func DecodeSum(sum exprcore.Value) (string, string, error)
- func OCICarTag(id string) string
- type CarData
- type CarExport
- type CarInspect
- type CarLookup
- type CarPack
- type CarPublish
- type CarReader
- type CarUnpack
- type Config
- type ConfigRepo
- type ExportedCar
- type GithubReleasesReader
- type InstallCar
- type InstallEnv
- type InstallStats
- type Installable
- type Instance
- type Option
- type PackageAdjustNames
- type PackageCalcInstall
- type PackageFixPerms
- type PackageInfo
- type PackageInstaller
- type PackageReadInfo
- type PackageRemoveCruft
- type PackageSelector
- type PackageWriteInfo
- type PackagesInstall
- type PackagesToInstall
- type Project
- func (p *Project) CalculateSet(ctx context.Context, ienv *InstallEnv) (*PackagesToInstall, error)
- func (p *Project) Explain(ctx context.Context, ienv *InstallEnv) error
- func (p *Project) ExplainHomebrew() error
- func (p *Project) Export(ctx context.Context, cfg *config.Config, dest string) ([]*ExportedCar, error)
- func (p *Project) FindCachedBuildOnlyDeps(pti *PackagesToInstall, dir string) ([]*ExportedCar, error)
- func (p *Project) InstallPackages(ctx context.Context, ienv *InstallEnv) ([]string, *PackagesToInstall, *InstallStats, error)
- func (c *Project) L() hclog.Logger
- func (p *Project) Resolve() (*homebrew.Resolution, error)
- func (c *Project) SetLogger(logger hclog.Logger)
- type ProjectLoad
- func (c *ProjectLoad) L() hclog.Logger
- func (c *ProjectLoad) Load(ctx context.Context, cfg *config.Config) (*Project, error)
- func (c *ProjectLoad) LoadSet(ctx context.Context, cfg *config.Config, path string) (*Project, error)
- func (l *ProjectLoad) Search(ctx context.Context, code SearchCond) ([]*data.RepoEntry, error)
- func (c *ProjectLoad) SetLogger(logger hclog.Logger)
- func (c *ProjectLoad) Single(ctx context.Context, cfg *config.Config, name string) (*Project, error)
- type ProjectSource
- type RepoDetect
- type RepoReadIndex
- type RepoWriteIndex
- type RunCtx
- type ScannedPackage
- type ScriptCalcDeps
- type ScriptCalcSig
- type ScriptData
- type ScriptFile
- type ScriptInput
- type ScriptInstall
- type ScriptLoad
- type ScriptLookup
- func (c *ScriptLookup) L() hclog.Logger
- func (s *ScriptLookup) Load(name string) (ScriptData, error)
- func (s *ScriptLookup) LoadDir(dir, name string) (ScriptData, error)
- func (s *ScriptLookup) LoadFile(path string) (ScriptData, error)
- func (s *ScriptLookup) LoadGithub(repo, name string) (ScriptData, error)
- func (c *ScriptLookup) SetLogger(logger hclog.Logger)
- func (s *ScriptLookup) Walk(fn func(string, ScriptData) error) error
- func (s *ScriptLookup) WalkDir(dir string, fn func(string, ScriptData) error) error
- type ScriptPackage
- func (s *ScriptPackage) Attr(name string) (exprcore.Value, error)
- func (s *ScriptPackage) AttrNames() []string
- func (s *ScriptPackage) Constraints() map[string]string
- func (s *ScriptPackage) Dependencies() []*ScriptPackage
- func (s *ScriptPackage) DependencyNames() []string
- func (s *ScriptPackage) Description() string
- func (s *ScriptPackage) Freeze()
- func (s *ScriptPackage) Hash() (uint32, error)
- func (s *ScriptPackage) ID() string
- func (s *ScriptPackage) Metadata() map[string]string
- func (s *ScriptPackage) Name() string
- func (s *ScriptPackage) Repo() string
- func (s *ScriptPackage) RepoConfig() repo.Repo
- func (s *ScriptPackage) Signature() string
- func (s *ScriptPackage) String() string
- func (s *ScriptPackage) Truth() exprcore.Bool
- func (s *ScriptPackage) Type() string
- func (s *ScriptPackage) URL() string
- func (s *ScriptPackage) Vendor() string
- func (s *ScriptPackage) Version() string
- type SearchCond
- type SearchResult
- type StoreFind
- type StoreFindDeps
- type StoreFreeze
- type StoreScan
- type UI
Constants ¶
const ( CarInfoJson = ".car-info.json" SignatureEntry = "~signature" MetadataOnly = "#fakedir" )
const ( Extension = ".xcr" ExportExtension = ".export" + Extension )
xcr == exprcore files
Variables ¶
var ( ErrInvalidSignature = errors.New("invalid signature") ErrNoSignature = errors.New("no signature") )
var ErrBadScript = errors.New("script error detected")
var ErrCorruption = errors.New("corruption detected")
var ErrInstallError = errors.New("installation error")
var (
ErrNotFound = errors.New("entry not found")
)
var ErrSumFormat = fmt.Errorf("sum must a tuple with (sum-type, sum)")
var NoCarData = errors.New("no car data found")
var RunCtxFunctions = exprcore.StringDict{ "system": exprcore.NewBuiltin("system", systemFn), "shell": exprcore.NewBuiltin("shell", shellFn), "apply_patch": exprcore.NewBuiltin("apply_patch", patchFn), "inreplace": exprcore.NewBuiltin("inreplace", inreplaceFn), "inreplace_re": exprcore.NewBuiltin("inreplace_re", inreplaceReFn), "rm_f": exprcore.NewBuiltin("rm_f", rmrfFn), "rm_rf": exprcore.NewBuiltin("rm_rf", rmrfFn), "set_env": exprcore.NewBuiltin("set_env", setEnvFn), "append_env": exprcore.NewBuiltin("append_env", appendEnvFn), "prepend_env": exprcore.NewBuiltin("prepend_env", prependEnvFn), "link": exprcore.NewBuiltin("link", linkFn), "install_files": exprcore.NewBuiltin("install_files", installFn), "write_file": exprcore.NewBuiltin("write_file", writeFileFn), "chdir": exprcore.NewBuiltin("chdir", chdirFn), "set_root": exprcore.NewBuiltin("set_root", setRootFn), "mkdir": exprcore.NewBuiltin("mkdir", mkdirFn), "download": exprcore.NewBuiltin("download", downloadFn), "unpack": exprcore.NewBuiltin("unpack", unpackFn), "set_shebang": exprcore.NewBuiltin("set_shebang", setShebangFn), }
Functions ¶
func CompareEtag ¶
Types ¶
type CarExport ¶
type CarExport struct {
// contains filtered or unexported fields
}
func (*CarExport) Export ¶
func (c *CarExport) Export(pkg *ScriptPackage, path, dest string) (*ExportedCar, error)
type CarInspect ¶
type CarPack ¶
type CarPublish ¶
func (*CarPublish) PublishCar ¶
func (c *CarPublish) PublishCar(ctx context.Context, path, repo string) error
type Config ¶
type Config struct {
Repos map[string]*ConfigRepo
}
type ConfigRepo ¶
type ExportedCar ¶
type ExportedCar struct { Package *ScriptPackage Info *data.CarInfo Path string Sum []byte }
type GithubReleasesReader ¶
type GithubReleasesReader struct {
// contains filtered or unexported fields
}
func (*GithubReleasesReader) Info ¶
func (g *GithubReleasesReader) Info(name string) (*data.CarInfo, error)
func (*GithubReleasesReader) Lookup ¶
func (g *GithubReleasesReader) Lookup(name string) (io.ReadCloser, error)
type InstallCar ¶
type InstallCar struct {
// contains filtered or unexported fields
}
func (*InstallCar) Install ¶
func (i *InstallCar) Install(ctx context.Context, ienv *InstallEnv) error
type InstallEnv ¶
type InstallEnv struct { // Directory to create build dirs in BuildDir string // Directory that contains installed packages Store *config.Store // Directory that packages can use to store data such as gems, config files, // etc. StateDir string // Start a shell StartShell bool // Contains paths to installed packages PackagePaths map[string]string // Indicates that the build process should retain the build dir RetainBuild bool // SkipPostInstall indicates that we should not run any post_install // functions. This is typically used when we're building a package // only to package it as a .car file. SkipPostInstall bool // PostInstallOnly indicates that we should not run any install // functions, only run post_install. This is typically used when we're // installing a .car and allow the package to adjust it into place. OnlyPostInstall bool // If set, install will generate a .car file for the packages install into // ExportPath. It performs the export before running post_install so the packages // are sealed properly. ExportPath string // When using ExportPath, this will be populated with the information about the car // files written. ExportedCars []*ExportedCar Config *config.Config }
type Installable ¶
type Instance ¶
type Instance struct { Id string Name string Version string Signature string Fn *exprcore.Function Dependencies []*ScriptPackage Path string Data []byte }
func NewDataInstance ¶
func (*Instance) Freeze ¶
func (i *Instance) Freeze()
Freeze causes the value, and all values transitively reachable from it through collections and closures, to be marked as frozen. All subsequent mutations to the data structure through this API will fail dynamically, making the data structure immutable and safe for publishing to other exprcore interpreters running concurrently.
func (*Instance) Hash ¶
Hash returns a function of x such that Equals(x, y) => Hash(x) == Hash(y). Hash may fail if the value's type is not hashable, or if the value contains a non-hashable value. The hash is used only by dictionaries and is not exposed to the exprcore program.
func (*Instance) String ¶
String returns the string representation of the value. exprcore string values are quoted as if by Python's repr.
type Option ¶
type Option func(c *loadCfg)
func WithConfigRepo ¶
func WithConfigRepo(cr *ConfigRepo) Option
func WithConstraints ¶
func WithNamespace ¶
type PackageAdjustNames ¶
type PackageAdjustNames struct {
// contains filtered or unexported fields
}
func (*PackageAdjustNames) Adjust ¶
func (p *PackageAdjustNames) Adjust(dir string) error
type PackageCalcInstall ¶
type PackageCalcInstall struct { Store *config.Store CarCache []string // contains filtered or unexported fields }
func (*PackageCalcInstall) Calculate ¶
func (p *PackageCalcInstall) Calculate(pkg *ScriptPackage) (*PackagesToInstall, error)
func (*PackageCalcInstall) CalculateSet ¶
func (p *PackageCalcInstall) CalculateSet(pkgs []*ScriptPackage) (*PackagesToInstall, error)
type PackageFixPerms ¶
type PackageFixPerms struct {
// contains filtered or unexported fields
}
func (*PackageFixPerms) Fix ¶
func (p *PackageFixPerms) Fix(path string) error
Fix adjusts the permissions of the files in path. Mostly it fixes the perms of anything in the bin/ dir.
type PackageInfo ¶
type PackageInfo interface {
PackageInfo() (name, repo, signer string)
}
type PackageInstaller ¶
type PackageInstaller interface {
Install(ctx context.Context, ienv *InstallEnv) error
}
type PackageReadInfo ¶
func (*PackageReadInfo) Read ¶
func (p *PackageReadInfo) Read(pkg *ScriptPackage) (*data.PackageInfo, error)
func (*PackageReadInfo) ReadPath ¶
func (p *PackageReadInfo) ReadPath(pkg *ScriptPackage, root string) (*data.PackageInfo, error)
type PackageRemoveCruft ¶
type PackageRemoveCruft struct {
// contains filtered or unexported fields
}
func (*PackageRemoveCruft) RemoveCruft ¶
func (p *PackageRemoveCruft) RemoveCruft(path string) error
type PackageSelector ¶
func (*PackageSelector) Freeze ¶
func (l *PackageSelector) Freeze()
func (*PackageSelector) Hash ¶
func (l *PackageSelector) Hash() (uint32, error)
func (*PackageSelector) String ¶
func (l *PackageSelector) String() string
func (*PackageSelector) Truth ¶
func (l *PackageSelector) Truth() exprcore.Bool
func (*PackageSelector) Type ¶
func (l *PackageSelector) Type() string
type PackageWriteInfo ¶
type PackageWriteInfo struct {
// contains filtered or unexported fields
}
func (*PackageWriteInfo) Write ¶
func (p *PackageWriteInfo) Write(pkg *ScriptPackage) (*data.PackageInfo, error)
type PackagesInstall ¶
type PackagesInstall struct { Installed []string Failed string // contains filtered or unexported fields }
func (*PackagesInstall) Install ¶
func (p *PackagesInstall) Install( ctx context.Context, ienv *InstallEnv, toInstall *PackagesToInstall, ) (*InstallStats, error)
type PackagesToInstall ¶
type Project ¶
type Project struct { Constraints map[string]string Cellar string Install []*ScriptPackage Requested []string // contains filtered or unexported fields }
func (*Project) CalculateSet ¶
func (p *Project) CalculateSet(ctx context.Context, ienv *InstallEnv) (*PackagesToInstall, error)
func (*Project) ExplainHomebrew ¶
func (*Project) FindCachedBuildOnlyDeps ¶
func (p *Project) FindCachedBuildOnlyDeps(pti *PackagesToInstall, dir string) ([]*ExportedCar, error)
func (*Project) InstallPackages ¶
func (p *Project) InstallPackages(ctx context.Context, ienv *InstallEnv) ( []string, *PackagesToInstall, *InstallStats, error, )
type ProjectLoad ¶
type ProjectLoad struct {
// contains filtered or unexported fields
}
func (*ProjectLoad) Search ¶
func (l *ProjectLoad) Search(ctx context.Context, code SearchCond) ([]*data.RepoEntry, error)
type ProjectSource ¶
type RepoDetect ¶
type RepoDetect struct {
// contains filtered or unexported fields
}
type RepoReadIndex ¶
type RepoReadIndex struct {
// contains filtered or unexported fields
}
type RepoWriteIndex ¶
type RepoWriteIndex struct {
// contains filtered or unexported fields
}
func (*RepoWriteIndex) Write ¶
func (r *RepoWriteIndex) Write() error
type RunCtx ¶
type RunCtx struct { L hclog.Logger // contains filtered or unexported fields }
func (*RunCtx) Freeze ¶
func (r *RunCtx) Freeze()
Freeze causes the value, and all values transitively reachable from it through collections and closures, to be marked as frozen. All subsequent mutations to the data structure through this API will fail dynamically, making the data structure immutable and safe for publishing to other exprcore interpreters running concurrently.
func (*RunCtx) Hash ¶
Hash returns a function of x such that Equals(x, y) => Hash(x) == Hash(y). Hash may fail if the value's type is not hashable, or if the value contains a non-hashable value. The hash is used only by dictionaries and is not exposed to the exprcore program.
func (*RunCtx) String ¶
String returns the string representation of the value. exprcore string values are quoted as if by Python's repr.
type ScannedPackage ¶
type ScannedPackage struct { Path string Info *data.PackageInfo Package *ScriptPackage }
type ScriptCalcDeps ¶
type ScriptCalcDeps struct {
// contains filtered or unexported fields
}
func (*ScriptCalcDeps) BuildDeps ¶
func (i *ScriptCalcDeps) BuildDeps(pkg *ScriptPackage) ([]*ScriptPackage, error)
func (*ScriptCalcDeps) EvalDeps ¶
func (i *ScriptCalcDeps) EvalDeps(pkgs []*ScriptPackage) ([]*ScriptPackage, error)
func (*ScriptCalcDeps) RuntimeDeps ¶
func (i *ScriptCalcDeps) RuntimeDeps(pkg *ScriptPackage) ([]*ScriptPackage, error)
type ScriptCalcSig ¶
type ScriptCalcSig struct { Name string Version string Description string URL string Metadata map[string]string Install *exprcore.Function Hook *exprcore.Function PostInstall *exprcore.Function Inputs []ScriptInput Dependencies []*ScriptPackage ExplicitDeps []*ScriptPackage Instances []*Instance // contains filtered or unexported fields }
type ScriptData ¶
type ScriptFile ¶
type ScriptFile struct {
// contains filtered or unexported fields
}
func (*ScriptFile) Freeze ¶
func (s *ScriptFile) Freeze()
func (*ScriptFile) Hash ¶
func (s *ScriptFile) Hash() (uint32, error)
func (*ScriptFile) String ¶
func (s *ScriptFile) String() string
String returns the string representation of the value. exprcore string values are quoted as if by Python's repr.
func (*ScriptFile) Truth ¶
func (s *ScriptFile) Truth() exprcore.Bool
func (*ScriptFile) Type ¶
func (s *ScriptFile) Type() string
Type returns a short string describing the value's type.
type ScriptInput ¶
type ScriptInput struct { Name string Data *ScriptFile Instance *Instance }
type ScriptInstall ¶
type ScriptInstall struct {
// contains filtered or unexported fields
}
func (*ScriptInstall) Install ¶
func (i *ScriptInstall) Install(ctx context.Context, ienv *InstallEnv) error
type ScriptLoad ¶
func (*ScriptLoad) Load ¶
func (s *ScriptLoad) Load(name string, opts ...Option) (*ScriptPackage, error)
func (*ScriptLoad) Search ¶
func (s *ScriptLoad) Search(query string, opts ...Option) ([]*ScriptPackage, error)
type ScriptLookup ¶
type ScriptLookup struct { Path []string // contains filtered or unexported fields }
func (*ScriptLookup) Load ¶
func (s *ScriptLookup) Load(name string) (ScriptData, error)
func (*ScriptLookup) LoadDir ¶
func (s *ScriptLookup) LoadDir(dir, name string) (ScriptData, error)
func (*ScriptLookup) LoadFile ¶
func (s *ScriptLookup) LoadFile(path string) (ScriptData, error)
func (*ScriptLookup) LoadGithub ¶
func (s *ScriptLookup) LoadGithub(repo, name string) (ScriptData, error)
func (*ScriptLookup) Walk ¶
func (s *ScriptLookup) Walk(fn func(string, ScriptData) error) error
func (*ScriptLookup) WalkDir ¶
func (s *ScriptLookup) WalkDir(dir string, fn func(string, ScriptData) error) error
type ScriptPackage ¶
type ScriptPackage struct { PackageInfo *data.PackageInfo Instance *Instance // contains filtered or unexported fields }
func ProcessPrototype ¶
func (*ScriptPackage) AttrNames ¶
func (s *ScriptPackage) AttrNames() []string
func (*ScriptPackage) Constraints ¶
func (s *ScriptPackage) Constraints() map[string]string
func (*ScriptPackage) Dependencies ¶
func (s *ScriptPackage) Dependencies() []*ScriptPackage
Dependencies returns any ScriptPackages that this one depends on, as declared via the dependencies keyword.
func (*ScriptPackage) DependencyNames ¶
func (s *ScriptPackage) DependencyNames() []string
func (*ScriptPackage) Description ¶
func (s *ScriptPackage) Description() string
func (*ScriptPackage) Freeze ¶
func (s *ScriptPackage) Freeze()
Freeze causes the value, and all values transitively reachable from it through collections and closures, to be marked as frozen. All subsequent mutations to the data structure through this API will fail dynamically, making the data structure immutable and safe for publishing to other exprcore interpreters running concurrently.
func (*ScriptPackage) Hash ¶
func (s *ScriptPackage) Hash() (uint32, error)
Hash returns a function of x such that Equals(x, y) => Hash(x) == Hash(y). Hash may fail if the value's type is not hashable, or if the value contains a non-hashable value. The hash is used only by dictionaries and is not exposed to the exprcore program.
func (*ScriptPackage) ID ¶
func (s *ScriptPackage) ID() string
func (*ScriptPackage) Metadata ¶
func (s *ScriptPackage) Metadata() map[string]string
func (*ScriptPackage) Name ¶
func (s *ScriptPackage) Name() string
func (*ScriptPackage) Repo ¶
func (s *ScriptPackage) Repo() string
func (*ScriptPackage) RepoConfig ¶
func (s *ScriptPackage) RepoConfig() repo.Repo
func (*ScriptPackage) Signature ¶
func (s *ScriptPackage) Signature() string
func (*ScriptPackage) String ¶
func (s *ScriptPackage) String() string
String returns the string representation of the value. exprcore string values are quoted as if by Python's repr.
func (*ScriptPackage) Truth ¶
func (s *ScriptPackage) Truth() exprcore.Bool
Truth returns the truth value of an object.
func (*ScriptPackage) Type ¶
func (s *ScriptPackage) Type() string
Type returns a short string describing the value's type.
func (*ScriptPackage) URL ¶
func (s *ScriptPackage) URL() string
URL is the homepage for the project, not where to download it.
func (*ScriptPackage) Vendor ¶
func (s *ScriptPackage) Vendor() string
Returns the vendor (if any) that the script was loaded from in the repo.
func (*ScriptPackage) Version ¶
func (s *ScriptPackage) Version() string
type SearchCond ¶
func SearchJQ ¶
func SearchJQ(str string) (SearchCond, error)
func SearchRegexp ¶
func SearchRegexp(str string) (SearchCond, error)
type SearchResult ¶
type SearchResult struct {
Results []string
}
type StoreFindDeps ¶
type StoreFindDeps struct {
// contains filtered or unexported fields
}
func (*StoreFindDeps) PruneDeps ¶
func (s *StoreFindDeps) PruneDeps(id string, deps []*ScriptPackage) ([]*ScriptPackage, error)
type StoreFreeze ¶
type StoreFreeze struct {
// contains filtered or unexported fields
}
func (*StoreFreeze) Freeze ¶
func (s *StoreFreeze) Freeze(id string) error
type UI ¶
type UI struct { }
func (*UI) InstallCar ¶
func (*UI) ListDepedencies ¶
func (u *UI) ListDepedencies(pkgs []*ScriptPackage)
func (*UI) RunScript ¶
func (u *UI) RunScript(pkg *ScriptPackage) error
Source Files ¶
- car_export.go
- car_inspect.go
- car_lookup.go
- car_lookup_meta.go
- car_pack.go
- car_pack_detect.go
- car_publish.go
- car_unpack.go
- common.go
- err.go
- install_env.go
- instance.go
- package_adjust_names.go
- package_calc_install.go
- package_fix_perms.go
- package_read_info.go
- package_remove_cruft.go
- package_write_info.go
- packages_install.go
- project_load.go
- repo_detect.go
- repo_read_index.go
- repo_write_index.go
- script_all_deps.go
- script_calc_sig.go
- script_install.go
- script_load.go
- script_lookup.go
- store_find.go
- store_find_deps.go
- store_freeze.go
- store_scan.go
- stream_detect.go
- sum.go
- ui.go