discovery

package
v0.0.0-...-4168419 Latest Latest
Warning

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

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

Documentation

Overview

START: start

Package exposes functionality to get free (unused) ports on your system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPorts

func GetPorts(n int) []int

Get returns n ports that are free to use, panicing if it can't succeed.

func GetPortsWithErr

func GetPortsWithErr(n int) (ports []int, err error)

Get returns n ports that are free to use.

func GetSPorts

func GetSPorts(n int) []string

GetS returns n ports as strings that are free to use, panicing if it can't succeed.

func GetSPortsWithErr

func GetSPortsWithErr(n int) ([]string, error)

GetS return n ports (as strings) that are free to use.

Types

type Config

type Config struct {
	NodeName       string
	BindAddr       string
	Tags           map[string]string
	StartJoinAddrs []string
}

END: start START: setup

type Handler

type Handler interface {
	Join(name, addr string) error
	Leave(name string) error
}

START: handler

type Membership

type Membership struct {
	Config
	// contains filtered or unexported fields
}

func New

func New(handler Handler, config Config) (*Membership, error)

func (*Membership) Leave

func (m *Membership) Leave() error

func (*Membership) Members

func (m *Membership) Members() []serf.Member

Jump to

Keyboard shortcuts

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