registry

package
v0.0.0-...-535fc81 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerName string = "Tdtm"
	Version    string = "v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Discovery

type Discovery interface {
	Watch(ctx context.Context, serviceName string) (Watcher, error)
}

type Instance

type Instance struct {
	Id      string `json:"id"`
	Name    string `json:"name"`
	Version string `json:"version"`
	// examples:
	// http://127.0.0.1:8080
	Nodes []string `json:"node"`
}

func NewInstance

func NewInstance() *Instance

func Unmarshal

func Unmarshal(val []byte) (*Instance, error)

func (*Instance) InstanceName

func (instance *Instance) InstanceName() string

func (*Instance) Marshal

func (instance *Instance) Marshal() string

func (*Instance) String

func (instance *Instance) String() string

type Registry

type Registry interface {
	Register(ctx context.Context, instance *Instance) error
	DeRegister(ctx context.Context, instance *Instance) error
}

type Watcher

type Watcher interface {
	GetInstances() ([]*Instance, error)
	Next() ([]*Instance, error)
	Stop() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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