fixedset

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 3 Imported by: 0

README

go.serversets/fixedset Build Status Godoc Reference

Fixed set, i.e. severset without the zookeeper. This package implements a stub for Watch where endpoints are set manually vs. via zookeeper. This is useful for testing or to take advantage of the load balancing packages without the discovery part.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FixedSet

type FixedSet struct {
	LastEvent  time.Time
	EventCount int
	// contains filtered or unexported fields
}

FixedSet can be used as a fixed set of endpoints for testing or to use the load balancing functions without zookeeper.

func New

func New(endpoints []string) *FixedSet

New creates a new FixedSet with the given endpoints.

func (*FixedSet) Close

func (fs *FixedSet) Close()

Close for this service just sets a boolean since there isn't a lot of async stuff going on.

func (*FixedSet) Endpoints

func (fs *FixedSet) Endpoints() []string

Endpoints returns a slice of the current list of servers/endpoints associated with this watch.

func (*FixedSet) Event

func (fs *FixedSet) Event() <-chan struct{}

Event returns the event channel. This channel will get an object whenever something changes with the list of endpoints.

func (*FixedSet) IsClosed

func (fs *FixedSet) IsClosed() bool

IsClosed returns if this fixed set has been closed.

func (*FixedSet) SetEndpoints

func (fs *FixedSet) SetEndpoints(endpoints []string)

SetEndpoints sets current list of endpoints.

Jump to

Keyboard shortcuts

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