Documentation
¶
Index ¶
- Variables
- func AddrFromStr(str string) ma.Multiaddr
- func BindFlags(v *viper.Viper, root *cobra.Command, flags map[string]Flag) error
- func End(format string, args ...interface{})
- func ErrCheck(err error, args ...interface{})
- func ExpandConfigVars(v *viper.Viper, flags map[string]Flag)
- func Fatal(err error, args ...interface{})
- func FindConfigFile(conf *Config, pth string) bool
- func GetFlagOrEnvValue(c *cobra.Command, k, envPre string) (v string)
- func GetThreadType(isDB bool) string
- func InitConfig(conf *Config) func()
- func InitConfigCmd(rootCmd *cobra.Command, v *viper.Viper, dir string)
- func Message(format string, args ...interface{})
- func RenderTable(header []string, data [][]string)
- func Success(format string, args ...interface{})
- func Warn(format string, args ...interface{})
- func WriteConfig(c *cobra.Command, v *viper.Viper, name string)
- type Clients
- type Config
- type Flag
- type Thread
Constants ¶
This section is empty.
Variables ¶
var ( // Timeout is the default timeout used for most commands. Timeout = time.Minute * 10 // PushTimeout is the command timeout used when pushing bucket changes. PushTimeout = time.Hour * 24 // PullTimeout is the command timeout used when pulling bucket changes. PullTimeout = time.Hour * 24 // ArchiveWatchTimeout is the command timeout used when watching archive status messages. ArchiveWatchTimeout = time.Hour * 12 // Bold is a styler used to make the output text bold. Bold = promptui.Styler(promptui.FGBold) )
Functions ¶
func AddrFromStr ¶
AddrFromStr returns a multiaddress from the string.
func ExpandConfigVars ¶
ExpandConfigVars evaluates the viper config file's expressions.
func FindConfigFile ¶ added in v1.0.13
FindConfigFile searches up the path for a config file. True is returned is a config file was found and successfully loaded.
func GetFlagOrEnvValue ¶ added in v1.0.13
GetFlagOrEnvValue first load a value for the key from the command flags. If no value was found, the value for the corresponding env variable is returned.
func GetThreadType ¶ added in v1.0.4
GetThreadType returns a string representation of the type of a thread.
func InitConfig ¶
func InitConfig(conf *Config) func()
InitConfig returns a function that can be used to search for and load a config file.
func InitConfigCmd ¶ added in v1.0.4
InitConfigCmd adds a config generator command to the root command. The command will write the config file to dir.
func RenderTable ¶
Types ¶
type Clients ¶ added in v1.0.4
Clients wraps all the possible hubd/buckd clients.
func NewClients ¶ added in v1.0.4
NewClients returns a new clients object pointing to the target address. If isHub is true, the hub's admin and user clients are also created.
func (*Clients) ListThreads ¶ added in v1.0.4
ListThreads returns a list of threads for the context. In a hub context, this will only list threads that the context has access to. dbsOnly filters threads that do not belong to a database.