lib

package
v0.0.0-...-419bc47 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATE_CLEANUP_INTERVAL     = 30 * time.Second
	STATE_CLIENT_EXPIRY_DELAY  = proto.HEARTBEAT_MARK_DEAD_DELAY
	STATE_REQUEST_EXPIRY_DELAY = 10 * time.Minute

	DATA_PAGE_SIZE = 10
)

Variables

This section is empty.

Functions

func MkState

func MkState() *state

Types

type Client

type Client struct {
	Address string `gorm:"primaryKey"`

	FirstHeartbeatTime time.Time             `gorm:"not null"`
	LastHeartbeatTime  time.Time             `gorm:"not null"`
	LastHeartbeat      proto.PacketHeartbeat `gorm:"not null;serializer:json;type:json"`
}

type CommandContext

type CommandContext struct {
	Context    context.Context
	Config     *Config
	Client     *mautrix.Client
	Radio      *radio.Radio
	State      *state
	OwnPrivKey ed25519.PrivateKey
}

type Config

type Config struct {
	// The address of the homeserver to connect to for C2.
	Homeserver string

	// The username to authenticate to the HS with.
	Username string

	// The password to authenticate to the HS with.
	Password string

	// The Matrix room where administration occurs.
	AdminRoom string

	// Private key to use as identity on the pinecone network.
	PineconeId string

	// Whether to print pinecone's internal logs to stdout.
	LogPinecone bool

	// The address to listen for inbound pinecone connections on.
	PineconeInboundTcpAddr string

	// The address to listen for inbound HTTP connections on (allows pinecone over websocket and pinecone debug endpoint if enabled).
	PineconeInboundWebAddr string

	// The HTTP path of the pinecone debug endpoint on the pinecone webserver (omit to disable).
	PineconeDebugEndpoint string

	// Comma-delimeted list of static peers to connect to.
	PineconeUseMulticast bool

	// Whether to use multicast to discover pinecone peers on the local network.
	PineconeStaticPeers string
}

func (*Config) Setup

func (c *Config) Setup()

type Request

type Request struct {
	TxId   string `gorm:"primaryKey"`
	Target string `gorm:"index;not null"`

	RequestTime time.Time      `gorm:"not null"`
	Request     proto.PacketRR `gorm:"not null;serializer:json;type:json"`

	ResponseTime time.Time
	Response     proto.PacketRR `gorm:"serializer:json;type:json"`
}

Jump to

Keyboard shortcuts

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