network

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinerProtocolsTask = "minerprotocols" // task that observes the supported protocols of miners on the Filecoin network.
	PeerAgentsTask     = "peeragents"     // task that observes connected peer agents
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	minerprotocols.API
	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) Done added in v0.8.6

func (s *Surveyer) Done() <-chan struct{}

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