Documentation
¶
Index ¶
- func FormatUpstream(some interface{}) string
- type EndpointStatus
- type Provider
- type Upstream
- type UpstreamEndpoint
- type UpstreamHealthcheckFunc
- type UpstreamProvider
- func (prov *UpstreamProvider) GetAliveEndpoint(kind string, tries int) string
- func (prov *UpstreamProvider) GetEndpoint(kind string, exclude string, tries int) string
- func (prov *UpstreamProvider) GetMonitoringEventTypes() []string
- func (prov *UpstreamProvider) GetStatus(kind string) map[string]EndpointStatus
- func (prov *UpstreamProvider) SetObserver(mon monitoring.Observer)
- func (prov *UpstreamProvider) TcpCheck(addr string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatUpstream ¶
func FormatUpstream(some interface{}) string
Types ¶
type EndpointStatus ¶
type EndpointStatus int
const ( EndpointStatusHealthy EndpointStatus = 1 << iota EndpointStatusAvailable EndpointStatusUnreachable )
type Upstream ¶
type Upstream struct {
MustResolve bool
Addr *url.URL
Ports map[string]string
// contains filtered or unexported fields
}
func ParseUpstreamAddr ¶
func (*Upstream) CheckContinuously ¶
type UpstreamEndpoint ¶
type UpstreamEndpoint struct {
// contains filtered or unexported fields
}
func (*UpstreamEndpoint) GetAddr ¶
func (e *UpstreamEndpoint) GetAddr(kind string) string
type UpstreamHealthcheckFunc ¶
type UpstreamHealthcheckFunc func(context.Context, string) (EndpointStatus, error)
type UpstreamProvider ¶
type UpstreamProvider struct {
// contains filtered or unexported fields
}
func NewAlwaysAliveEndpoint ¶
func NewAlwaysAliveEndpoint(url string) *UpstreamProvider
func NewUpstreamProvider ¶
func NewUpstreamProvider(ctx context.Context, l *logrus.Logger, hosts []string, hc UpstreamHealthcheckFunc) (*UpstreamProvider, error)
func (*UpstreamProvider) GetAliveEndpoint ¶
func (prov *UpstreamProvider) GetAliveEndpoint(kind string, tries int) string
func (*UpstreamProvider) GetEndpoint ¶
func (prov *UpstreamProvider) GetEndpoint(kind string, exclude string, tries int) string
func (*UpstreamProvider) GetMonitoringEventTypes ¶
func (prov *UpstreamProvider) GetMonitoringEventTypes() []string
func (*UpstreamProvider) GetStatus ¶
func (prov *UpstreamProvider) GetStatus(kind string) map[string]EndpointStatus
func (*UpstreamProvider) SetObserver ¶
func (prov *UpstreamProvider) SetObserver(mon monitoring.Observer)
func (*UpstreamProvider) TcpCheck ¶
func (prov *UpstreamProvider) TcpCheck(addr string) bool
Click to show internal directories.
Click to hide internal directories.