-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Ensign Config Preventing GDS from Running (#1176)
- Loading branch information
Showing
9 changed files
with
42 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
package activity | ||
|
||
import ( | ||
"errors" | ||
"time" | ||
|
||
"github.com/trisacrypto/directory/pkg/utils/ensign" | ||
) | ||
|
||
type Config struct { | ||
Enabled bool `split_words:"true" default:"false"` | ||
Topic string `split_words:"true"` | ||
Network Network `split_words:"true"` | ||
Enabled bool `default:"false"` | ||
Topic string `required:"false"` | ||
Network Network `required:"false" validate:"ignore"` | ||
AggregationWindow time.Duration `split_words:"true" default:"5m"` | ||
Testing bool `split_words:"true" default:"false"` | ||
Ensign ensign.Config | ||
Testing bool `default:"false" ` | ||
Ensign ensign.Config `validate:"ignore"` | ||
} | ||
|
||
func (c Config) Validate() (err error) { | ||
if c.Enabled { | ||
if c.Topic == "" { | ||
return ErrMissingTopic | ||
err = errors.Join(err, ErrMissingTopic) | ||
} | ||
|
||
if err = c.Ensign.Validate(); err != nil { | ||
return err | ||
if verr := c.Network.Validate(); verr != nil { | ||
err = errors.Join(err, verr) | ||
} | ||
} | ||
|
||
return nil | ||
if verr := c.Ensign.Validate(); verr != nil { | ||
err = errors.Join(err, verr) | ||
} | ||
} | ||
return err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters