Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrSchemeInValid invalid scheme ErrSchemeInValid = errors.New("scheme invalid, should be http/https") // ErrHealthConfigNotInited show HealthConfig not inited ErrHealthConfigNotInited = errors.New("healthConfig not inited") )
View Source
var ( // ErrEndpointsClientNotInited show endpointsClient not inited ErrEndpointsClientNotInited = errors.New("endpointsClient not inited") )
View Source
var ( // ErrK8sConfigNotInited show K8sConfig not inited ErrK8sConfigNotInited = errors.New("k8sConfig not inited") )
Functions ¶
This section is empty.
Types ¶
type ClusterEndpointsIP ¶
type ClusterEndpointsIP interface { GetClusterEndpoints() ([]utils.EndPoint, error) SyncClusterEndpoints(ctx context.Context) Stop() }
ClusterEndpointsIP is a interface for sync kubernetes master endpointIPs
func NewEndpointsClient ¶
func NewEndpointsClient(opts ...EndpointsClientOption) (ClusterEndpointsIP, error)
NewEndpointsClient init endpoints client
type EndpointsClientOption ¶
type EndpointsClientOption func(options *EndpointsClientOptions)
EndpointsClientOption func for set EndpointsClientOptions
func WithHealthConfig ¶
func WithHealthConfig(healthConfig EndpointsHealthOptions) EndpointsClientOption
WithHealthConfig set health check options
func WithInterval ¶
func WithInterval(interval time.Duration) EndpointsClientOption
WithInterval set interval
func WithK8sConfig ¶
func WithK8sConfig(ks8Config K8sConfig) EndpointsClientOption
WithK8sConfig set k8sConfig
type EndpointsClientOptions ¶
type EndpointsClientOptions struct { K8sConfig K8sConfig HealthConfig EndpointsHealthOptions Interval time.Duration Debug bool }
EndpointsClientOptions conf options
type EndpointsHealthOptions ¶
EndpointsHealthOptions show health check scheme&path
type HealthCheck ¶
HealthCheck is interface for check addr:port health
func NewHealthConfig ¶
func NewHealthConfig(scheme string, path string) (HealthCheck, error)
NewHealthConfig init HealthConfig
type HealthConfig ¶
HealthConfig conf immutable schem/path
func (*HealthConfig) IsHTTPAPIHealth ¶
func (hc *HealthConfig) IsHTTPAPIHealth(addr string, port uint32) bool
IsHTTPAPIHealth for check schem://addr:port/Path health
type K8sConfig ¶
K8sConfig ...
func (*K8sConfig) GetKubernetesClient ¶
func (c *K8sConfig) GetKubernetesClient() (kubernetes.Interface, error)
GetKubernetesClient init kubernetes clientSet by k8sConfig
Click to show internal directories.
Click to hide internal directories.