NewFromKiteKey parses the given kite key file and gives a new Config value.
(file string)
| 152 | |
| 153 | // NewFromKiteKey parses the given kite key file and gives a new Config value. |
| 154 | func NewFromKiteKey(file string) (*Config, error) { |
| 155 | key, err := kitekey.ParseFile(file) |
| 156 | if err != nil { |
| 157 | return nil, err |
| 158 | } |
| 159 | |
| 160 | var c Config |
| 161 | if err := c.ReadToken(key); err != nil { |
| 162 | return nil, err |
| 163 | } |
| 164 | |
| 165 | return &c, nil |
| 166 | } |
| 167 | |
| 168 | func Get() (*Config, error) { |
| 169 | c := New() |