Documentation ¶
Index ¶
- Constants
- func GetExponentialBackOff(initialInterval time.Duration, maxElapsedTime time.Duration) *backoff.ExponentialBackOff
- func GrpcDialTransportSecurity(certPath string, keyPath string, caPath string) (grpc.DialOption, error)
- func NewDebugServer() *http.Server
- func NewHealthServer(healthService grpc_health_v1.HealthServer) *grpc.Server
- func NewProxyServer(proxyDirector *ProxyDirector) *grpc.Server
- type Adapter
- type Commander
- type HealthService
- type JSONFormatter
- type LocalAddrStore
- type LockProxy
- type Locker
- type MemoryAddrStore
- type Pinger
- type ProxyDirector
- type RemoteAddrStore
- type UpstreamAddrProvider
Constants ¶
View Source
const RFC3339Milli = "2006-01-02T15:04:05.999Z07:00"
Variables ¶
This section is empty.
Functions ¶
func GetExponentialBackOff ¶ added in v0.3.0
func NewDebugServer ¶
func NewHealthServer ¶
func NewHealthServer(healthService grpc_health_v1.HealthServer) *grpc.Server
func NewProxyServer ¶
func NewProxyServer(proxyDirector *ProxyDirector) *grpc.Server
Types ¶
type Commander ¶
type Commander struct {
// contains filtered or unexported fields
}
Commander starts the command. It handles graceful shutdown with a timeout after which the command is forcefully killed.
func NewCommander ¶
type HealthService ¶
type HealthService struct {
// contains filtered or unexported fields
}
func NewHealthService ¶
func NewHealthService(isLeader func(ctx context.Context) bool) *HealthService
func (*HealthService) Check ¶
func (s *HealthService) Check(ctx context.Context, req *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
func (*HealthService) Watch ¶
func (s *HealthService) Watch(req *grpc_health_v1.HealthCheckRequest, w grpc_health_v1.Health_WatchServer) error
type JSONFormatter ¶
type JSONFormatter struct {
*logrus.JSONFormatter
}
type LocalAddrStore ¶ added in v0.3.0
type LockProxy ¶
type LockProxy struct {
// contains filtered or unexported fields
}
func NewLockProxy ¶
type MemoryAddrStore ¶ added in v0.3.0
type MemoryAddrStore struct {
// contains filtered or unexported fields
}
MemoryAddrStore stores the current proxy address locally.
func NewMemoryAddrStore ¶ added in v0.3.0
func NewMemoryAddrStore( logger *logrus.Entry, ) *MemoryAddrStore
type ProxyDirector ¶
type ProxyDirector struct {
// contains filtered or unexported fields
}
ProxyDirector is gRPC connection handler. It is called for every gRPC method call. It gets the current upstream address from upstreamAddrProvider and fails with Unavailable if the address is not set. It accepts a global Context after which all the requests are cancelled.
If enabled and the current method is /grpc.health.v1.Health/* and the server is not leader we proxy the request to the our internal health server.
func NewProxyDirector ¶
func NewProxyDirector( ctx context.Context, upstreamAddrProvider UpstreamAddrProvider, healthAddr string, grpcDialTransportSecurity grpc.DialOption, grpcMaxCallRecvMsgSize int, grpcMaxCallSendMsgSize int, abortTimeout time.Duration, proxyHealthFollowerInternal bool, logger *logrus.Entry, ) *ProxyDirector
type RemoteAddrStore ¶ added in v0.3.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.