utils

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRemote added in v0.7.11

func AddRemote(cmd *cobra.Command, name string, uri string) error

func CombineExamples

func CombineExamples(sl []Example) string

func EnsureUserSet added in v0.8.4

func EnsureUserSet(cmd *cobra.Command, c *conf.Config) error

func ErrTableNotFound added in v0.8.4

func ErrTableNotFound(db objects.Store, rs ref.Store, commit *objects.Commit) error

func GetCredentials added in v0.10.5

func GetCredentials(cmd *cobra.Command, cs *credentials.Store, remote string) (uri *url.URL, token string, err error)

func GetRepoDir

func GetRepoDir(cmd *cobra.Command) *local.RepoDir

func GetRuneFromFlag added in v0.10.3

func GetRuneFromFlag(cmd *cobra.Command, flag string) (rune, error)

func GetTable added in v0.8.4

func GetTable(db objects.Store, rs ref.Store, commit *objects.Commit) (*objects.Table, error)

func GetWRGLDir

func GetWRGLDir() (string, error)

func HandleHTTPError added in v0.7.11

func HandleHTTPError(cmd *cobra.Command, cs *credentials.Store, remoteURL string, uri *url.URL, err error) error

func IsWrglhubRemote added in v0.10.3

func IsWrglhubRemote(s string) (username, reponame string, ok bool)

func MustGetRemote

func MustGetRemote(cmd *cobra.Command, c *conf.Config, name string) *conf.Remote

func MustWRGLDir

func MustWRGLDir(cmd *cobra.Command) string

func PBar added in v0.9.1

func PBar(max int64, desc string, out, err io.Writer) *progressbar.ProgressBar

func PagerOrOut

func PagerOrOut(cmd *cobra.Command) (io.Writer, func(), error)

func PrintAuthCmd added in v0.7.11

func PrintAuthCmd(cmd *cobra.Command, remoteURL string)

func PrintTable

func PrintTable(w io.Writer, rows [][]string, indent int)

PrintTable prints simple table from rows of text

func Prompt

func Prompt(cmd *cobra.Command, name string) (value string, err error)

func PromptForPassword

func PromptForPassword(cmd *cobra.Command) (password string, err error)

func RepoWebURI added in v0.10.3

func RepoWebURI(username, reponame string) string

func SetPromptValues

func SetPromptValues(ctx context.Context, values []string) context.Context

func SetupDebug

func SetupDebug(cmd *cobra.Command) (w io.Writer, cleanup func(), err error)

SetupDebug open debug file (specified with --debug-file) for writing

Types

type ClientMap added in v0.10.5

type ClientMap struct {
	CredsStore *credentials.Store
	// contains filtered or unexported fields
}

func NewClientMap added in v0.10.5

func NewClientMap() (*ClientMap, error)

func (*ClientMap) GetClient added in v0.10.5

func (m *ClientMap) GetClient(cmd *cobra.Command, cr *conf.Remote) (client *apiclient.Client, uri *url.URL, err error)

func (*ClientMap) GetRefs added in v0.10.5

func (m *ClientMap) GetRefs(cmd *cobra.Command, cr *conf.Remote) (refs map[string][]byte, err error)

type Example

type Example struct {
	Comment string
	Line    string
}

Jump to

Keyboard shortcuts

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