common

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: BSD-3-Clause Imports: 9 Imported by: ? modules, 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

Index

Constants

View Source
const LiveLogsTopic = "/patrick/logs/v1"

LiveLogsTopic carries a running job's log as the monkey writes it, so Patrick can stream it to clients before the job ends and its log is stored.

Variables

View Source
var (
	UpdateBroadcastTimeout    time.Duration = 3 * time.Second
	UpdateBroadcastRetryPause time.Duration = 100 * time.Millisecond
)
View Source
var (
	// A wrap for the generate method for tests to override
	GetNewProjectID = id.Generate

	// Accounts ID generators — overridable in tests for deterministic IDs.
	GetNewAccountID = id.Generate
	GetNewMemberID  = id.Generate
	GetNewUserID    = id.Generate
	GetNewPlanID    = id.Generate
	GetNewSessionID = id.Generate
)
View Source
var (
	// From Patrick
	FakeSecret        = false
	DelayJob          = false
	RetryJob          = false
	DelayJobTime      = 60 * time.Second
	MaxCancelAttempts = 30
	MaxJobAttempts    = 2

	// From Monkey
	MockedPatrick          = false
	TimeoutTest            = false
	DefaultLockTime        = 60 * time.Second // a claim not refreshed for this long goes back on the queue
	DefaultMaxTime         = 1 * time.Hour
	DefaultRefreshLockTime = 20 * time.Second // how often a building Monkey refreshes its claim
	DefaultTestTimeOut     = 5 * time.Second
)
View Source
var (
	Auth         = "auth"
	AuthProtocol = "/auth/v1"

	Hoarder         = "hoarder"
	HoarderProtocol = "/hoarder/v1"

	Monkey         = "monkey"
	MonkeyProtocol = "/monkey/v1"

	Substrate         = "substrate"
	SubstrateProtocol = "/substrate/v1"

	Tns         = "tns"
	TnsProtocol = "/tns/v1"

	Seer         = "seer"
	SeerProtocol = "/seer/v1"

	// TODO: Merge with substrate
	SubstrateP2P         = "substrate-p2p"
	SubstrateP2PProtocol = "/substrate/p2p/v1"

	Gateway = "gateway"

	Patrick         = "patrick"
	PatrickProtocol = "/patrick/v1"

	OraclePubSubPath = "/seer/oracle/v1"
)
View Source
var (
	DefaultDnsPort = 53
)

TODO: These ports are tied to generic config/dream and will need looked at moving generic config

Functions

func StartSeerBeacon

func StartSeerBeacon(cfg config.Config, sc seer.Client, serviceTypes []seer.ServiceType) error

StartSeerBeacon announces the given service types from this node through a single seer client and one usage/geo beacon goroutine set. A node running several services (a shape) beacons once for all of them, instead of opening a client and beacon per service. Callers build the client (see clients/p2p/seer.StartNodeBeacon) so this package need not depend on it.

func SwarmKey

func SwarmKey() pnet.PSK

Types

type LiveLogChunk added in v1.3.0

type LiveLogChunk struct {
	Job    string `cbor:"1,keyasint"`
	Offset int64  `cbor:"2,keyasint"`
	Data   []byte `cbor:"3,keyasint"`
	Done   bool   `cbor:"4,keyasint"`
	// Run tells apart runs of one job: a job a dead monkey left behind runs again
	// on another, whose log starts over at offset 0.
	Run string `cbor:"5,keyasint"`
}

LiveLogChunk is a piece of a job's log starting at Offset bytes into it. The last chunk of a job has Done set and may carry no data.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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