config: add Validate func, small lint fixes

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2022-03-22 14:54:43 +03:00
parent 5527b16cd8
commit c64218d52c
15 changed files with 177 additions and 52 deletions

View File

@@ -50,6 +50,7 @@ type Handler func(Event) error
// Events contains multiple events
type Events []Event
// Ack try to ack all events and return
func (evs Events) Ack() error {
var err error
for _, ev := range evs {
@@ -60,6 +61,7 @@ func (evs Events) Ack() error {
return nil
}
// SetError sets error on event
func (evs Events) SetError(err error) {
for _, ev := range evs {
ev.SetError(err)