connectivity

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StatusCode

type StatusCode uint32

StatusCode is a connectivity status.

const (
	// StatusConnectionOk indicates that session, payments, ip change are all working.
	StatusConnectionOk StatusCode = 1000

	// StatusSessionEstablishmentFailed indicates that session is failed to establish.
	StatusSessionEstablishmentFailed StatusCode = 2000

	// StatusSessionPaymentsFailed indicates that session payments failed.
	StatusSessionPaymentsFailed StatusCode = 2001

	// StatusSessionIPNotChanged indicates that session is established but ip is not changed.
	StatusSessionIPNotChanged StatusCode = 2002

	// StatusConnectionFailed indicates unknown session connection error.
	StatusConnectionFailed StatusCode = 2003
)

type StatusEntry

type StatusEntry struct {
	PeerID       identity.Identity
	SessionID    string
	StatusCode   StatusCode
	Message      string
	CreatedAtUTC time.Time
}

StatusEntry describes status entry.

type StatusStorage

type StatusStorage interface {
	GetAllStatusEntries() []StatusEntry
	AddStatusEntry(msg StatusEntry)
}

StatusStorage is responsible for status storage operations.

func NewStatusStorage

func NewStatusStorage() StatusStorage

NewStatusStorage returns new StatusStorage instance.

Jump to

Keyboard shortcuts

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