cli

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: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTokenMap

func NewTokenMap(tokensVar, gitCredentialsVar string) (map[string]string, error)

NewTokenMap Returns a tokenstring from a token env var in the form host:token,host:token or from a gitcredentialsvar which points to the gitcredentials location

func TokensFromGitCredentialsFile

func TokensFromGitCredentialsFile(contents []byte) (map[string]string, error)

TokensFromGitCredentialsFile returns a map of host:token a git credentials file

func TokensFromString

func TokensFromString(str string) map[string]string

TokensFromString returns a map of host:token from a string in form: host:token,host:token

Types

type Retriever

type Retriever struct {
	gop.Updater
	// contains filtered or unexported fields
}

Retriever Is a CLI retriever that can be used for retrieving and caching for cli tools that require remote imports

func Default

func Default(fs afero.Fs, cacheDir string, proxyURL string, tokens map[string]string, privateKeyFile string, password string) Retriever

func Moduler

func Moduler(fs afero.Fs, cacheFile, cacheDir string, proxyURL string, tokens map[string]string, privateKeyFile string, password string, logger gop.Logger) Retriever

func New

func New(local gop.Gopper, cache gop.Gopper, proxy gop.Retriever, github gop.Retriever, versioner gop.Updater, git gop.Retriever, cacheFile string, log gop.Logger) Retriever

func (Retriever) Command

func (r Retriever) Command(cmd, repo string) error

Command is meant to be used in a cli tool with cmd and repo args

func (Retriever) Retrieve

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

Retrieve implements the retriever interface

Jump to

Keyboard shortcuts

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