Documentation
¶
Overview ¶
Package http provides the utility for balancer on http protocol with consul.
Index ¶
Constants ¶
View Source
const ( DEFAULT_TIMEOUT_SECONDS_4_READY = 5 // Default value for TimeoutSeconds4Ready DEFAULT_TIMEOUT_SECONDS_4_REQUEST = 10 // Default value for timeoutSeconds4Request )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpBalancer ¶
type HttpBalancer struct {
// contains filtered or unexported fields
}
the object for http balancer, it use fasthttp.LBClient to do the process of balance.
func NewHttpBalancer ¶
func NewHttpBalancer(config *ServiceConfig) (*HttpBalancer, error)
NewHttpBalancer init an instance of HttpBalancer
type ServiceConfig ¶
type ServiceConfig struct { ServiceName string // The name for the serivce Tags []string // The tags used for registering the service TimeoutSeconds4Ready uint32 // The max time wait for the service's ready in consul, default value is DEFAULT_TIMEOUT_SECONDS_4_READY ConsulConfig *api.Config // The consul's config, it can be nil // contains filtered or unexported fields }
the config used for initial HttpBalancer
Click to show internal directories.
Click to hide internal directories.