discovery

package
v0.0.0-...-d3354c4 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: LGPL-2.1 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Directory

type Directory interface {
	Get(friends.ID) []Mapping
	Put(Mapping)
	Track(friends.ID)

	Scan(func(Mapping) bool)
	Subscribe() chan Mapping
}

type Mapping

type Mapping struct {
	Who       friends.ID
	Where     string
	Timestamp time.Time
}

type Notifier

type Notifier struct {
	// contains filtered or unexported fields
}

func (*Notifier) Notify

func (n *Notifier) Notify(m Mapping) (count int)

func (*Notifier) Subscribe

func (n *Notifier) Subscribe() chan Mapping

func (*Notifier) Unsubscribe

func (n *Notifier) Unsubscribe(ch chan Mapping)

type Provider

type Provider interface {
	Serve(dir Directory) error
	SetLocalEndpoints([]string)
	Shutdown()
}

type SimpleDirectory

type SimpleDirectory struct {
	Notifier
	// contains filtered or unexported fields
}

func NewSimpleDirectory

func NewSimpleDirectory() *SimpleDirectory

func (*SimpleDirectory) Get

func (sd *SimpleDirectory) Get(who friends.ID) []Mapping

func (*SimpleDirectory) Put

func (sd *SimpleDirectory) Put(m Mapping)

func (*SimpleDirectory) Scan

func (sd *SimpleDirectory) Scan(f func(Mapping) bool)

func (*SimpleDirectory) Track

func (sd *SimpleDirectory) Track(id friends.ID)

func (*SimpleDirectory) Tracking

func (sd *SimpleDirectory) Tracking(id friends.ID) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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