resources: Officially add Validate method
This officially adds the Validate method to the resource API, and also cleans up the ordering in existing resources.
This commit is contained in:
@@ -60,17 +60,17 @@ func (obj *TimerRes) Default() Res {
|
||||
return &TimerRes{}
|
||||
}
|
||||
|
||||
// Validate the params that are passed to TimerRes.
|
||||
func (obj *TimerRes) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Init runs some startup code for this resource.
|
||||
func (obj *TimerRes) Init() error {
|
||||
obj.BaseRes.kind = "Timer"
|
||||
return obj.BaseRes.Init() // call base init, b/c we're overrriding
|
||||
}
|
||||
|
||||
// Validate the params that are passed to TimerRes.
|
||||
func (obj *TimerRes) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// newTicker creates a new ticker
|
||||
func (obj *TimerRes) newTicker() *time.Ticker {
|
||||
return time.NewTicker(time.Duration(obj.Interval) * time.Second)
|
||||
|
||||
Reference in New Issue
Block a user