Discovery Nats automate

This commit is contained in:
mr 2024-08-22 15:04:01 +02:00
parent c8a1377851
commit 6c28684859
2 changed files with 4 additions and 3 deletions

View File

@ -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{}

View File

@ -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{}