fix global err names

add BulkPush and BulkPop
This commit is contained in:
alexisvisco 2019-03-27 11:09:09 +01:00
parent 33d5ed706f
commit 80b7d7367f
4 changed files with 168 additions and 9 deletions

View file

@ -5,7 +5,7 @@ import (
"fmt"
)
var InvalidActionName = errors.New("invalid action name")
var ErrActionName = errors.New("invalid action name")
// Controllable is used for administration purposes.
type Controllable interface {
@ -42,7 +42,7 @@ func NewControl(host string, port int, password string) (Controllable, error) {
func (c ControlChannel) Trigger(action Action) (err error) {
if IsActionValid(action) {
return InvalidActionName
return ErrActionName
}
err = c.write(fmt.Sprintf("TRIGGER %s", action))
if err != nil {