actor

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsActorCmd

func IsActorCmd(args []string) bool

Types

type Actor

type Actor struct {
	ID ActorID

	*GlobalActorData

	CurrentPeerstore track.DynamicPeerstore

	PeerStatusState   status.PeerStatusState
	PeerMetadataState metadata.PeerMetadataState

	ChainState chain.ChainState

	Dv5State dv5.Dv5State

	GossipState gossip.GossipState
	RPCState    rpc.RPCState

	HostState host.HostState

	ActorCtx context.Context
	// contains filtered or unexported fields
}

func NewActor

func NewActor(id ActorID, globals *GlobalActorData) *Actor

func (*Actor) Close

func (r *Actor) Close()

func (*Actor) MakeCmd

func (r *Actor) MakeCmd(log logrus.FieldLogger, spawnCtx base.SpawnFn) *ActorCmd

type ActorCmd

type ActorCmd struct {
	*Actor
	// To log things while the command runs, including spawned processes
	Log logrus.FieldLogger
	// For non-blocking tasks to end later. E.g. serving data in the background.
	SpawnContext base.SpawnFn
}

func (*ActorCmd) Cmd

func (c *ActorCmd) Cmd(route string) (cmd interface{}, err error)

func (*ActorCmd) Help

func (c *ActorCmd) Help() string

func (*ActorCmd) Routes

func (c *ActorCmd) Routes() []string

type ActorID

type ActorID string

type GlobalActorData

type GlobalActorData struct {
	GlobalCtx        context.Context
	GlobalPeerstores track.Peerstores
	GlobalChains     chaindata.Chains

	Blocks bdb.DB
	States sdb.DB
}

type SleepCmd

type SleepCmd struct {
	*base.Base
	Time time.Duration `ask:"<time>" help:"How long to sleep, e.g. 3s"`
}

func (*SleepCmd) Default

func (c *SleepCmd) Default()

func (*SleepCmd) Help

func (c *SleepCmd) Help() string

func (*SleepCmd) Run

func (c *SleepCmd) Run(ctx context.Context, args ...string) error

Jump to

Keyboard shortcuts

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