123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- package connectivity
- import (
- "golang.org/x/net/context"
- "google.golang.org/grpc/grpclog"
- )
- type State int
- func (s State) String() string {
- switch s {
- case Idle:
- return "IDLE"
- case Connecting:
- return "CONNECTING"
- case Ready:
- return "READY"
- case TransientFailure:
- return "TRANSIENT_FAILURE"
- case Shutdown:
- return "SHUTDOWN"
- default:
- grpclog.Errorf("unknown connectivity state: %d", s)
- return "Invalid-State"
- }
- }
- const (
-
- Idle State = iota
-
- Connecting
-
- Ready
-
- TransientFailure
-
- Shutdown
- )
- type Reporter interface {
-
- CurrentState() State
-
-
-
- WaitForStateChange(context.Context, State) bool
- }
|