Documentation ¶
Index ¶
Constants ¶
View Source
const ( // LabelsKeyServiceID is used to define the ID of the service LabelsKeyServiceID = "kratos-service-id" // LabelsKeyServiceName is used to define the name of the service LabelsKeyServiceName = "kratos-service-app" // LabelsKeyServiceVersion is used to define the version of the service LabelsKeyServiceVersion = "kratos-service-version" // AnnotationsKeyMetadata is used to define the metadata of the service AnnotationsKeyMetadata = "kratos-service-metadata" // AnnotationsKeyProtocolMap is used to define the protocols of the service // Through the value of this field, Kratos can obtain the application layer protocol corresponding to the port // Example value: {"80": "http", "8081": "grpc"} AnnotationsKeyProtocolMap = "kratos-service-protocols" )
Variables ¶
View Source
var ErrIteratorClosed = errors.New("iterator closed")
ErrIteratorClosed defines the error that the iterator is closed
Functions ¶
This section is empty.
Types ¶
type ErrorHandleResource ¶
ErrorHandleResource defines the error that cannot handle K8S resources normally
func (*ErrorHandleResource) Error ¶
func (err *ErrorHandleResource) Error() string
Error implements the error interface
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
Iterator 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 Iterator through stopCh
func NewIterator ¶
func NewIterator(channel chan []*registry.ServiceInstance, stopCh chan struct{}) *Iterator
NewIterator is used to initialize Iterator
type KubernetesDiscovery ¶
type KubernetesDiscovery struct {
// contains filtered or unexported fields
}
func NewKubernetesDiscovery ¶
func NewKubernetesDiscovery(options *regOps.DiscoveryOptions) (*KubernetesDiscovery, error)
func (*KubernetesDiscovery) Close ¶
func (d *KubernetesDiscovery) Close()
Close is used to close the Registry After closing, any callbacks generated by Watch will not be executed
func (*KubernetesDiscovery) GetService ¶
func (d *KubernetesDiscovery) GetService(ctx context.Context, name string) ([]*registry.ServiceInstance, error)
GetService return the service instances in memory according to the service name.
func (*KubernetesDiscovery) Start ¶
func (d *KubernetesDiscovery) Start()
Start is used to start the Registry It is non-blocking
Click to show internal directories.
Click to hide internal directories.