modules

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPath

func AddPath(repoVer string, path string) string

func GetApiURL

func GetApiURL(resource string) string

func LoadVersion

func LoadVersion(retriever gop.Retriever, cacher gop.Cacher, resolver Resolver, cacheFile, resource string) (string, error)

LoadVersion returns the version from a version

func ReplaceImports

func ReplaceImports(modFile []byte, sourceFile []byte) ([]byte, error)

ReplaceImports replaces the contents of sourcefile with the imports in modfile

func ReplaceSpecificImport

func ReplaceSpecificImport(content string, oldrepo, oldver, newrepo, newver string) string

ReplaceSpecificImport replaces a specific import in content

Types

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

func NewLoader

func NewLoader(gopper gop.Gopper, resolver Resolver, cacheFile string, log gop.Logger) Loader

func (Loader) Get

func (a Loader) Get(repo string) error

func (Loader) Init

func (a Loader) Init() error

func (Loader) Resolve

func (a Loader) Resolve(resource string) string

Resolve resolves an import from resource to a full commit hash

func (Loader) Update

func (a Loader) Update(version string) error

Update updates the base of version to the version

func (Loader) UpdateAll

func (a Loader) UpdateAll() error

func (Loader) UpdateTo

func (a Loader) UpdateTo(old, new string) error

type Modules

type Modules struct {
	Imports map[string]string `yaml:"imports"`
}

Modules is the representation of the module file:

type Resolver

type Resolver func(string) (string, error)

Resolver resolves a git ref to a hash

type Retriever

type Retriever struct {
	// contains filtered or unexported fields
}

func New

func New(retriever gop.Retriever, importFile string) Retriever

func (Retriever) Retrieve

func (a Retriever) Retrieve(resource string) ([]byte, bool, error)

Retrieve retrieves a resource and replaces its import statements with the patterns described in the import file

Jump to

Keyboard shortcuts

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