Discovery Nats automate
This commit is contained in:
parent
c8a1377851
commit
6c28684859
@ -18,10 +18,11 @@ const (
|
||||
DB_FALLOUT
|
||||
TEAPOT
|
||||
DEAD
|
||||
WAITING
|
||||
)
|
||||
|
||||
func ToState(str string) State {
|
||||
for _, s := range []State{ALIVE, REDUCED_SERVICE, UNPROCESSABLE_ENTITY, DB_FALLOUT, TEAPOT, DEAD} {
|
||||
for _, s := range []State{ALIVE, REDUCED_SERVICE, UNPROCESSABLE_ENTITY, DB_FALLOUT, TEAPOT, DEAD, WAITING} {
|
||||
if s.String() == str {
|
||||
return s
|
||||
}
|
||||
@ -31,7 +32,7 @@ func ToState(str string) State {
|
||||
|
||||
func (s State) String() string {
|
||||
return [...]string{"alive", "reduced service", "unprocessable entity", "database fallout",
|
||||
"some things boils in here, i'm probably a teapot", "dead"}[s]
|
||||
"some things boils in here, i'm probably a teapot", "dead", "waiting"}[s]
|
||||
}
|
||||
|
||||
type API struct{}
|
||||
|
@ -32,7 +32,7 @@ func (d NATSMethod) GenerateKey(name string) string {
|
||||
}
|
||||
|
||||
func (d NATSMethod) String() string {
|
||||
return [...]string{"remove", "create"}[d]
|
||||
return [...]string{"remove", "create", "discovery"}[d]
|
||||
}
|
||||
|
||||
type natsCaller struct{}
|
||||
|
Loading…
Reference in New Issue
Block a user