Documentation
¶
Index ¶
- Constants
- Variables
- func CleanLegacyName(list map[string]deps.Dependency)
- func Ensure(direct v1.JsonnetFile, vendorDir string, oldLocks map[string]deps.Dependency) (map[string]deps.Dependency, error)
- func LoadRegistries() error
- func PrintHeader(writer io.Writer, headers []string)
- func PrintRow(writer io.Writer, line []string)
- func SearchPackage(ctx context.Context, query string) (map[string][]Package, error)
- func UpdateRegistries(ctx context.Context) error
- type GitPackage
- type GitRegistry
- type Interface
- type LocalPackage
- type Package
- type RegistryConfig
- type Version
- type Versions
Constants ¶
const RegistryFile = "~/.config/jsonnet-bundler/registries.yaml"
Variables ¶
var GitQuiet = false
var (
VersionMismatch = errors.New("multiple colliding versions specified")
)
Functions ¶
func CleanLegacyName ¶
func CleanLegacyName(list map[string]deps.Dependency)
func Ensure ¶
func Ensure(direct v1.JsonnetFile, vendorDir string, oldLocks map[string]deps.Dependency) (map[string]deps.Dependency, error)
Ensure receives all direct packages, the directory to vendor into and all known locks. It then makes sure all direct and nested dependencies are present in vendor at the correct version:
If the package is locked and the files in vendor match the sha256 checksum, nothing needs to be done. Otherwise, the package is retrieved from the upstream source and added into vendor. If previously locked, the sums are checked as well. In case a (nested) package is already present in the lock, the one from the lock takes precedence. This allows the user to set the desired version in case by `jb install`ing it.
Finally, all unknown files and directories are removed from vendor/ The full list of locked depedencies is returned
func LoadRegistries ¶
func LoadRegistries() error
func PrintHeader ¶
func SearchPackage ¶
func UpdateRegistries ¶
Types ¶
type GitPackage ¶
type GitRegistry ¶
type GitRegistry struct { Name string `yaml:"name"` Description string `yaml:"description"` Source string `yaml:"source"` PackageFile string `yaml:"filename"` }
GitRegistry implements the Registry interface and supports registries in git
func NewGitRegistry ¶
func NewGitRegistry(name, description, source, packageFile string) *GitRegistry
NewGitRegistry creates an instance of GitRegistry
func (GitRegistry) CleanCache ¶
func (r GitRegistry) CleanCache() error
type Interface ¶
type Interface interface {
Install(ctx context.Context, name, dir, version string) (lockVersion string, err error)
}
func NewGitPackage ¶
func NewLocalPackage ¶
type LocalPackage ¶
type Package ¶
type Package struct { Name string `json:"name"` Description string `json:"description"` Source string `json:"source"` Versions Versions `json:"versions"` }
Package describes a package referenced in a registry
type RegistryConfig ¶
type RegistryConfig struct { // Dir is the path where the registry config(s) are stored Entries []GitRegistry `yaml:"registries"` }
var Registries *RegistryConfig
func DefaultConfig ¶
func DefaultConfig() *RegistryConfig
func (RegistryConfig) SaveRegistries ¶
func (c RegistryConfig) SaveRegistries() error