cmd

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Timeout              = time.Minute
	TimeoutArchiveStatus = time.Second * 5
	TimeoutArchiveWatch  = time.Hour * 12
	Bold                 = promptui.Styler(promptui.FGBold)
)

Functions

func AddrFromStr

func AddrFromStr(str string) ma.Multiaddr

func BindFlags

func BindFlags(v *viper.Viper, root *cobra.Command, flags map[string]Flag) error

func End

func End(format string, args ...interface{})

func ExpandConfigVars

func ExpandConfigVars(v *viper.Viper, flags map[string]Flag)

func Fatal

func Fatal(err error, args ...interface{})

func GetThreadType added in v1.0.4

func GetThreadType(isDB bool) string

func InitConfig

func InitConfig(conf Config) func()

func InitConfigCmd added in v1.0.4

func InitConfigCmd(rootCmd *cobra.Command, v *viper.Viper, dir string)

func Message

func Message(format string, args ...interface{})

func RenderTable

func RenderTable(header []string, data [][]string)

func Success

func Success(format string, args ...interface{})

func ThreadIDFromString added in v1.0.4

func ThreadIDFromString(str string) thread.ID

func Warn added in v1.0.2

func Warn(format string, args ...interface{})

func WriteConfig added in v1.0.4

func WriteConfig(c *cobra.Command, v *viper.Viper, name string)

Types

type Clients added in v1.0.4

type Clients struct {
	Buckets *bc.Client
	Threads *tc.Client
	Hub     *hc.Client
	Users   *uc.Client

	Ctx ClientsCtx
}

func NewClients added in v1.0.4

func NewClients(target string, hub bool, ctx ClientsCtx) *Clients

func (*Clients) Close added in v1.0.4

func (c *Clients) Close()

func (*Clients) ListThreads added in v1.0.4

func (c *Clients) ListThreads(dbsOnly bool) []Thread

func (*Clients) SelectThread added in v1.0.4

func (c *Clients) SelectThread(label, successMsg string, dbsOnly bool) Thread

type ClientsCtx added in v1.0.4

type ClientsCtx interface {
	Auth(time.Duration) (context.Context, context.CancelFunc)
	Thread(time.Duration) (context.Context, context.CancelFunc)
}

type Config added in v1.0.4

type Config struct {
	Viper  *viper.Viper
	File   string
	Dir    string
	Name   string
	Flags  map[string]Flag
	EnvPre string
	Global bool
}

type Flag

type Flag struct {
	Key      string
	DefValue interface{}
}

type Thread added in v1.0.4

type Thread struct {
	ID    thread.ID
	Label string
	Name  string
	Type  string
}

Directories

Path Synopsis
cli
hub
cli

Jump to

Keyboard shortcuts

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