event

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

Documentation

Index

Constants

View Source
const (
	// AppTopicSession represents the session change topic.
	AppTopicSession = "Session change"
	// AppTopicDataTransferred represents the data transfer topic.
	AppTopicDataTransferred = "Session data transferred"
	// AppTopicTokensEarned is a topic for publish events about tokens earned as a provider.
	AppTopicTokensEarned = "SessionTokensEarned"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppEventDataTransferred

type AppEventDataTransferred struct {
	ID       string
	Up, Down uint64
}

AppEventDataTransferred represents the data transfer event

type AppEventSession

type AppEventSession struct {
	Status  Status
	Service ServiceContext
	Session SessionContext
}

AppEventSession represents the session change payload

type AppEventTokensEarned

type AppEventTokensEarned struct {
	ProviderID identity.Identity
	SessionID  string
	Total      *big.Int
}

AppEventTokensEarned is an update on tokens earned during current session

type ServiceContext

type ServiceContext struct {
	ID string
}

ServiceContext holds service context metadata

type SessionContext

type SessionContext struct {
	ID               string
	StartedAt        time.Time
	ConsumerID       identity.Identity
	ConsumerLocation market.Location
	HermesID         common.Address
	Proposal         market.ServiceProposal
}

SessionContext holds session context metadata

type Status

type Status string

Status represents the different actions that might happen on a session

const (
	// CreatedStatus indicates a session has been created
	CreatedStatus Status = "CreatedStatus"
	// RemovedStatus indicates a session has been removed
	RemovedStatus Status = "RemovedStatus"
	// AcknowledgedStatus indicates a session has been reported as a success from consumer side
	AcknowledgedStatus Status = "AcknowledgedStatus"
)

Jump to

Keyboard shortcuts

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