add jobs
This commit is contained in:
@@ -18,6 +18,8 @@ const (
|
||||
TopicProcessed Topic = "event:processed"
|
||||
// TopicUserRegister is a Topic of type UserRegister.
|
||||
TopicUserRegister Topic = "user:register"
|
||||
// TopicPostCreated is a Topic of type PostCreated.
|
||||
TopicPostCreated Topic = "post:created"
|
||||
)
|
||||
|
||||
var ErrInvalidTopic = fmt.Errorf("not a valid Topic, try [%s]", strings.Join(_TopicNames, ", "))
|
||||
@@ -25,6 +27,7 @@ var ErrInvalidTopic = fmt.Errorf("not a valid Topic, try [%s]", strings.Join(_To
|
||||
var _TopicNames = []string{
|
||||
string(TopicProcessed),
|
||||
string(TopicUserRegister),
|
||||
string(TopicPostCreated),
|
||||
}
|
||||
|
||||
// TopicNames returns a list of possible string values of Topic.
|
||||
@@ -39,6 +42,7 @@ func TopicValues() []Topic {
|
||||
return []Topic{
|
||||
TopicProcessed,
|
||||
TopicUserRegister,
|
||||
TopicPostCreated,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +61,7 @@ func (x Topic) IsValid() bool {
|
||||
var _TopicValue = map[string]Topic{
|
||||
"event:processed": TopicProcessed,
|
||||
"user:register": TopicUserRegister,
|
||||
"post:created": TopicPostCreated,
|
||||
}
|
||||
|
||||
// ParseTopic attempts to convert a string to a Topic.
|
||||
|
||||
Reference in New Issue
Block a user