forked from thrasher-corp/gocryptotrader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.go
36 lines (30 loc) · 906 Bytes
/
base.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
package base
import (
"time"
)
// Settings enforces standard variables across the provider packages
type Settings struct {
Name string `json:"name"`
Enabled bool `json:"enabled"`
Verbose bool `json:"verbose"`
RESTPollingDelay time.Duration `json:"restPollingDelay"`
APIKey string `json:"apiKey"`
APIKeyLvl int `json:"apiKeyLvl"`
PrimaryProvider bool `json:"primaryProvider"`
}
// Base enforces standard variables across the provider packages
type Base struct {
Settings `json:"settings"`
}
// GetName returns name of provider
func (b *Base) GetName() string {
return b.Name
}
// IsEnabled returns true if enabled
func (b *Base) IsEnabled() bool {
return b.Enabled
}
// IsPrimaryProvider returns true if primary provider
func (b *Base) IsPrimaryProvider() bool {
return b.PrimaryProvider
}