subscriber

package
v0.0.0-...-32c792f Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Once

func Once(w Watcher, s Subscription, logger *log.Entry, send chan *structs.Action, destroyCh chan interface{})

Once is a generic one-off query for Nomad

func Stream

func Stream(w Streamer, s Subscription, logger *log.Entry, send chan *structs.Action, destroyCh chan interface{})

Stream is a generic one-off query for Nomad

func Unwatch

func Unwatch(w Keyer, s Subscription, logger *log.Entry) error

Unwatch is a generic watcher for Nomad

func Watch

func Watch(w Watcher, s Subscription, logger *log.Entry, cfg *config.Config, send chan *structs.Action, destroyCh chan interface{})

Watch is a generic watcher for Nomad

Types

type Keyer

type Keyer interface {
	Key() string
}

Keyer interface

type Manager

type Manager struct {
	sync.Mutex
	sync.WaitGroup
	// contains filtered or unexported fields
}

Manager ...

func (*Manager) Clear

func (m *Manager) Clear()

Clear the list

func (*Manager) Count

func (m *Manager) Count() int64

func (*Manager) Subscribe

func (m *Manager) Subscribe(key string) chan interface{}

Subscribe ...

func (*Manager) Subscribed

func (m *Manager) Subscribed(key string) bool

Subscribed ...

func (*Manager) Subscriptions

func (m *Manager) Subscriptions() []string

Subscriptions ...

func (*Manager) Unsubscribe

func (m *Manager) Unsubscribe(key string) bool

Unsubscribe ...

type Streamer

type Streamer interface {
	Do(send chan *structs.Action, subscribeCh chan interface{}, destroyCh chan interface{}) (structs.Response, error)
	Key() string
	IsMutable() bool
	BackendType() string
}

Streamer interface

type Subscription

type Subscription interface {
	Subscribe(key string) chan interface{}
	Subscribed(key string) bool
	Unsubscribe(key string) bool
}

type Watcher

type Watcher interface {
	Do() (structs.Response, error)
	Key() string
	IsMutable() bool
	BackendType() string
}

Watcher interface

Jump to

Keyboard shortcuts

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