Documentation ¶
Index ¶
- Constants
- type Cfg
- type Registry
- func (s *Registry) Close()
- func (s *Registry) Deregister(service *registry.Service, opt ...registry.DeregOpt) result.Error
- func (s *Registry) GetService(name string, opt ...registry.GetOpt) result.List[*registry.Service]
- func (s *Registry) Init()
- func (s *Registry) ListService(opt ...registry.ListOpt) result.List[*registry.Service]
- func (s *Registry) Register(service *registry.Service, opt ...registry.RegOpt) result.Error
- func (s *Registry) String() string
- func (s *Registry) Watch(name string, opt ...registry.WatchOpt) result.Result[registry.Watcher]
- type Watcher
Constants ¶
View Source
const ( // LabelsKeyServiceID is used to define the ID of the service LabelsKeyServiceID = "lava-service-id" // LabelsKeyServiceName is used to define the name of the service LabelsKeyServiceName = "lava-service-app" // LabelsKeyServiceVersion is used to define the version of the service LabelsKeyServiceVersion = "lava-service-version" // AnnotationsKeyMetadata is used to define the metadata of the service AnnotationsKeyMetadata = "lava-service-metadata" // AnnotationsKeyProtocolMap is used to define the protocols of the service // Through the value of this field, lava can obtain the application layer protocol corresponding to the port // Example value: {"80": "http", "8081": "grpc"} AnnotationsKeyProtocolMap = "lava-service-protocols" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cfg ¶
type Cfg struct { // kube namespace Namespace string // kube labelSelector example `app=test` LabelSelector string // kube fieldSelector example `app=test` FieldSelector string // set KubeConfig out-of-cluster Use outside cluster KubeConfig string // set master url Master string Filename string }
func (*Cfg) Build ¶
func (t *Cfg) Build() *kubernetes.Clientset
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry The registry simply implements service discovery based on Kubernetes It has not been verified in the production environment and is currently for reference only
func NewRegistry ¶
func NewRegistry(clientSet *kubernetes.Clientset) *Registry
NewRegistry is used to initialize the Registry
func (*Registry) Deregister ¶
func (*Registry) GetService ¶
func (*Registry) ListService ¶
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher performs the conversion from channel to iterator It reads the latest changes from the `chan []*registry.ServiceInstance` And the outside can sense the closure of Watcher through stopCh
Click to show internal directories.
Click to hide internal directories.