protocol

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: AGPL-3.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package protocol defines types for the clock protocol.

Index

Constants

This section is empty.

Variables

View Source
var ProtocolID = protocol.ID("/stratumn/node/clock/v1.0.0")

ProtocolID is the protocol ID of the protocol.

Functions

This section is empty.

Types

type Clock

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

Clock implements the clock protocol.

func NewClock

func NewClock(host Host, timeout time.Duration) *Clock

NewClock creates a new clock.

func (*Clock) ProtocolID

func (c *Clock) ProtocolID() protocol.ID

ProtocolID returns this protocol ID

func (*Clock) RemoteTime

func (c *Clock) RemoteTime(ctx context.Context, pid peer.ID) (*time.Time, error)

RemoteTime asks a peer for its time.

func (*Clock) StreamHandler

func (c *Clock) StreamHandler(ctx context.Context, stream inet.Stream)

StreamHandler handles incoming messages from a peer.

func (*Clock) Wait

func (c *Clock) Wait()

Wait waits for all the streams to be closed.

type Host

type Host = ihost.Host

Host represents a Stratumn Node host.

Jump to

Keyboard shortcuts

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