-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
56 lines (45 loc) · 1.11 KB
/
config.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
46
47
48
49
50
51
52
53
54
55
56
package cmd
//TODO: Figure this out for load/save of config file
// import (
// "os"
// "path/filepath"
// "github.com/kirsle/configdir"
// "gopkg.in/ini.v1"
// )
// type Client struct {
// CoordinationServerTags string `ini:"coordination_server_tags"`
// }
// type Auth struct {
// ClientID string `ini:"client_id"`
// ClientSecret string `ini:"client_secret"`
// AuthKey string `ini:"auth_key"`
// }
// type Config struct {
// TailsysKey string `ini:"tailsys_key"`
// Port int `ini:"port"`
// Client
// Auth
// }
// func (config *Config) Load() error {
// configPath := configdir.LocalConfig("tailsys")
// err := configdir.MakePath(configPath)
// if err != nil {
// return err
// }
// configFile := filepath.Join(configPath, "tailsys.toml")
// //Config file exists?
// if _, err = os.Stat(configFile); os.IsNotExist(err) {
// _, err := os.Create(configFile)
// if err != nil {
// return err
// }
// }
// _, err = ini.Load(configFile)
// if err != nil {
// return err
// }
// return nil
// }
// func (config *Config) Valid() bool {
// return true
// }