network

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: Apache-2.0, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PeerAgentsTask = "peeragents" // task that observes connected peer agents
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	peeragents.API
}

type Surveyer

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

An Surveyer observes features of the filecoin network

func NewSurveyer

func NewSurveyer(api API, storage model.Storage, interval time.Duration, name string, tasks []string) (*Surveyer, error)

func (*Surveyer) Details

func (s *Surveyer) Details() (string, map[string]interface{})

func (*Surveyer) Run

func (s *Surveyer) Run(ctx context.Context) error

Run starts observing the filecoin netwoirk and continues until the context is done or a fatal error occurs.

func (*Surveyer) Tick

func (s *Surveyer) Tick(ctx context.Context) error

Tick is called on each tick of the surveyer's interval

type Task

type Task interface {
	Process(ctx context.Context) (model.Persistable, error)
	Close() error
}

type TaskResult

type TaskResult struct {
	Task        string
	Error       error
	Data        model.Persistable
	StartedAt   time.Time
	CompletedAt time.Time
}

A TaskResult is either some data to persist or an error which indicates that the task did not complete. Partial completions are possible provided the Data contains a persistable log of the results.

Jump to

Keyboard shortcuts

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