instances

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInstanceNotFound = errors.New("the requested instance was not found")

Functions

This section is empty.

Types

type Instance

type Instance struct {
	// contains filtered or unexported fields
}
var Blank Instance // nolint: gochecknoglobals

func MustNew

func MustNew(id string, ip net.IP, port int) Instance

func New

func New(id string, ip net.IP, port int) (Instance, error)

func (Instance) GetAddr

func (ins Instance) GetAddr() addr.Addr

func (Instance) GetDottedIP

func (ins Instance) GetDottedIP() string

func (Instance) GetID

func (ins Instance) GetID() string

func (Instance) GetIP

func (ins Instance) GetIP() net.IP

func (Instance) GetPort

func (ins Instance) GetPort() int

type Repository

type Repository interface {
	Add(context.Context, Instance) error
	GetByID(context.Context, string) (Instance, error)
	GetByAddr(context.Context, addr.Addr) (Instance, error)
	RemoveByID(context.Context, string) error
	RemoveByAddr(context.Context, addr.Addr) error
	Count(context.Context) (int, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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