base

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	WithHost
	// Shared between actors
	GlobalContext context.Context
	// For actor
	ActorContext context.Context
	// For non-blocking tasks to end later. E.g. serving data in the background.
	SpawnContext SpawnFn
	// For command
	Log logrus.FieldLogger
}

type SpawnFn

type SpawnFn func() (ctx context.Context, done context.CancelFunc)

SpawnFn spawns background tasks. Ctx is used to terminate spawned resources. Done is called after the spawned resources are fully freed.

type WithHost

type WithHost interface {
	Host() (h host.Host, err error)
	GetEnr() *enr.Record
	GetIP() net.IP
	GetTCP() uint16
	GetUDP() uint16
}

Jump to

Keyboard shortcuts

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