naming

package
v0.0.0-...-e7f8777 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("service not found")
)

Functions

This section is empty.

Types

type DefaultService

type DefaultService struct {
	ID        string
	Name      string
	Address   string
	Port      uint16
	Protocol  string
	Namespace string
	Tags      []string
	Meta      map[string]string
}

implementation of qim.Service and qim.ServiceRegistration

func NewEntry

func NewEntry(id, name, protocol, address string, port uint16) *DefaultService

func (*DefaultService) DialURL

func (s *DefaultService) DialURL() string

DialURL implements qim.ServiceRegistration

func (*DefaultService) GetMeta

func (s *DefaultService) GetMeta() map[string]string

GetMeta implements qim.Service

func (*DefaultService) GetNamespace

func (s *DefaultService) GetNamespace() string

GetNamespace implements qim.ServiceRegistration

func (*DefaultService) GetProtocol

func (s *DefaultService) GetProtocol() string

GetProtocol implements qim.ServiceRegistration

func (*DefaultService) GetTags

func (s *DefaultService) GetTags() []string

GetTags implements qim.ServiceRegistration

func (*DefaultService) PublicAddress

func (s *DefaultService) PublicAddress() string

PublicAddress implements qim.ServiceRegistration

func (*DefaultService) PublicPort

func (s *DefaultService) PublicPort() uint16

PublicPort implements qim.ServiceRegistration

func (*DefaultService) ServiceID

func (s *DefaultService) ServiceID() string

ServiceID implements qim.Service

func (*DefaultService) ServiceName

func (s *DefaultService) ServiceName() string

ServiceName implements qim.Service

func (*DefaultService) String

func (s *DefaultService) String() string

String implements qim.ServiceRegistration

type Naming

type Naming interface {
	Find(serviceName string, tags ...string) ([]qim.ServiceRegistration, error)
	Subscribe(serviceName string, callback func(services []qim.ServiceRegistration)) error
	Unsubscribe(serviceName string) error
	Register(service qim.ServiceRegistration) error
	Deregister(serviceID string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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