registry

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Services = make(map[string]Discovery)

Functions

This section is empty.

Types

type Decode

type Decode func(val string) (*Node, error)

Decode func is decode service node info

type Discovery

type Discovery interface {
	GetNodes() []servicer.Node
	GetUpdateTime() time.Time
	Close() error
}

Discovery is service discovery

type Encode

type Encode func(node *Node) (string, error)

Encode func is encode service node info

type Node

type Node struct {
	Host   string
	Port   int
	Weight int // TODO support service weight
}

type Registrar

type Registrar interface {
	Register(ctx context.Context) error
	DeRegister(ctx context.Context) error
}

Registrar is service registrar

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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