forked from fbsobreira/gotron-sdk
/
values.go
45 lines (38 loc) · 989 Bytes
/
values.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package cmd
import (
"github.com/fatih/color"
)
const (
tronctlDocsDir = "tronctl-docs"
defaultNodeAddr = "grpc.trongrid.io:50051"
defaultTimeout = 20
)
var (
g = color.New(color.FgGreen).SprintFunc()
)
// Directories
var (
// ConfigDir is the directory to store config file
ConfigDir string
// DefaultConfigFile is the default config file name
DefaultConfigFile string
)
// Error strings
var (
// ErrConfigNotMatch indicates error for no config matchs
ErrConfigNotMatch = "no config matchs"
// ErrEmptyEndpoint indicates error for empty endpoint
ErrEmptyEndpoint = "no endpoint has been set"
)
// Config defines the config schema
type Config struct {
Node string `yaml:"node"`
Ledger bool `yaml:"ledger"`
Verbose bool `yaml:"verbose"`
Timeout uint32 `yaml:"timeout"`
NoPretty bool `yaml:"noPretty"`
APIKey string `yaml:"apiKey"`
WithTLS bool `yaml:"withTLS"`
}
// ReadConfig represents the current config read from local
var config *Config