publisher

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2021 License: BSD-3-Clause Imports: 10 Imported by: 4

Documentation

Overview

Package publisher provides a type to publish names to a mounttable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T

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

T manages the publishing of names and servers in the mounttable. It spawns an internal goroutine the periodically performs mount and unmount rpcs. T is safe to use concurrently.

func New

func New(ctx *context.T, ns namespace.T, period time.Duration) *T

New returns a new publisher that updates mounts on ns every period, and when changes are made to the state.

func (*T) AddName

func (p *T) AddName(name string, mt bool, leaf bool)

AddName adds a new name for all servers to be mounted as.

func (*T) AddServer

func (p *T) AddServer(server string)

AddServer adds a new server to be mounted under all names.

func (*T) Closed

func (p *T) Closed() <-chan struct{}

Closed returns a channel that is closed when the publisher context is cancelled, and all unmount operations terminate.

func (*T) RemoveName

func (p *T) RemoveName(name string)

RemoveName removes a name.

func (*T) RemoveServer

func (p *T) RemoveServer(server string)

RemoveServer removes a server from the list of mounts.

func (*T) Status

func (p *T) Status() ([]rpc.PublisherEntry, <-chan struct{})

Status returns a snapshot of the publisher's current state. The returned channel is closed when the state has become stale and the caller should repoll Status.

func (*T) String

func (p *T) String() string

String returns a string representation of the publisher.

Jump to

Keyboard shortcuts

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