endpoint

package
v0.0.0-...-75d5455 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package endpoint xxx

Index

Constants

This section is empty.

Variables

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)
}

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 WithDebug

func WithDebug(debug bool) EndpointsClientOption

WithDebug set debug for unit test

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

type EndpointsHealthOptions struct {
	Scheme string
	Path   string
}

EndpointsHealthOptions show health check scheme&path

type K8sConfig

type K8sConfig struct {
	Mater      string `json:"master"`
	KubeConfig string `json:"kubeConfig"`
}

K8sConfig xxx

func (*K8sConfig) GetKubernetesClient

func (c *K8sConfig) GetKubernetesClient() (kubernetes.Interface, error)

GetKubernetesClient init kubernetes clientSet by k8sConfig

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL