mx

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: Apache-2.0, MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock interface {
	Accuracy() time.Duration
	After(d time.Duration, callback func()) clock.CancelFunc
	Ticker(userExpire time.Duration, callback func()) clock.CancelFunc
}

type FilterFunc

type FilterFunc func(int, host.Host) bool

func SelectIDs

func SelectIDs(ids ...peer.ID) FilterFunc

func SelectIndex

func SelectIndex(i int) FilterFunc

type HostSlice

type HostSlice []host.Host

func (HostSlice) Filter

func (hs HostSlice) Filter(f FilterFunc) HostSlice

func (HostSlice) Go

func (hs HostSlice) Go(f func(i int, h host.Host) error) error

func (HostSlice) Len

func (hs HostSlice) Len() int

func (HostSlice) Less

func (hs HostSlice) Less(i, j int) bool

func (HostSlice) Map

func (hs HostSlice) Map(f func(i int, h host.Host) error) (err error)

func (HostSlice) Swap

func (hs HostSlice) Swap(i, j int)

type MapFunc

type MapFunc func(ctx context.Context, sim Simulation, i int, h host.Host) error

type Maybe

type Maybe func(HostSlice) (HostSlice, error)

func (Maybe) Then

func (m Maybe) Then(next Maybe) Maybe

type Op

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

func (Op) Call

func (op Op) Call(ctx context.Context, hs ...host.Host) OpCall

func (Op) Then

func (op Op) Then(call OpFunc) Op

type OpCall

type OpCall func() error

func (OpCall) Err

func (call OpCall) Err() error

func (OpCall) Must

func (call OpCall) Must()

type OpFunc

type OpFunc func(s Simulation) func(ctx context.Context) Maybe

func Announce

func Announce(t net.Topology, ns string, opt ...discovery.Option) OpFunc

func Discover

func Discover(t net.Topology, ns string, opt ...discovery.Option) OpFunc

func Filter

func Filter(f FilterFunc) OpFunc

func Go

func Go(f MapFunc) OpFunc

func Map

func Map(f MapFunc) OpFunc

func Select

func Select(f SelectFunc) OpFunc

func (OpFunc) Then

func (fn OpFunc) Then(next OpFunc) OpFunc

type SelectFunc

type SelectFunc func(ctx context.Context, sim Simulation, hs HostSlice) (HostSlice, error)

type Simulation

type Simulation interface {
	Clock() Clock
	NewHost(ctx context.Context, opt ...config.Option) (host.Host, error)
	MustHost(ctx context.Context, opt ...config.Option) host.Host
	NewDiscovery(info peer.AddrInfo, s net.Topology) discovery.Discovery
	Op(...OpFunc) Op
}

func New

func New(ctx context.Context) Simulation

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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