Update NATS channel allowed
This commit is contained in:
@@ -22,7 +22,8 @@ type NATSResponse struct {
|
||||
// NATS Method Enum defines the different methods that can be used to interact with the NATS server
|
||||
type NATSMethod int
|
||||
|
||||
var meths = []string{"remove execution", "create execution", "discovery", "workflow event", "peer discovery"}
|
||||
var meths = []string{"remove execution", "create execution", "discovery",
|
||||
"workflow event", "remove peer", "create peer", "create resource", "remove resource", "propalgation event"}
|
||||
|
||||
const (
|
||||
REMOVE_EXECUTION NATSMethod = iota
|
||||
@@ -35,6 +36,8 @@ const (
|
||||
|
||||
CREATE_RESOURCE
|
||||
REMOVE_RESOURCE
|
||||
|
||||
PROPALGATION_EVENT
|
||||
)
|
||||
|
||||
func (n NATSMethod) String() string {
|
||||
@@ -44,7 +47,7 @@ func (n NATSMethod) String() string {
|
||||
// NameToMethod returns the NATSMethod enum value from a string
|
||||
func NameToMethod(name string) NATSMethod {
|
||||
for _, v := range [...]NATSMethod{REMOVE_EXECUTION, CREATE_EXECTUTION, DISCOVERY, WORKFLOW_EVENT,
|
||||
REMOVE_PEER, CREATE_PEER, CREATE_RESOURCE, REMOVE_RESOURCE} {
|
||||
REMOVE_PEER, CREATE_PEER, CREATE_RESOURCE, REMOVE_RESOURCE, PROPALGATION_EVENT} {
|
||||
if strings.Contains(strings.ToLower(v.String()), strings.ToLower(name)) {
|
||||
return v
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user