usage

package
v2.32.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AGPLInserter

type AGPLInserter struct{}

AGPLInserter is a no-op implementation of Inserter.

func (AGPLInserter) InsertDiscreteUsageEvent

func (AGPLInserter) InsertDiscreteUsageEvent(_ context.Context, _ database.Store, _ usagetypes.DiscreteEvent) error

InsertDiscreteUsageEvent is a no-op implementation of InsertDiscreteUsageEvent.

func (AGPLInserter) InsertHeartbeatUsageEvent added in v2.32.0

func (AGPLInserter) InsertHeartbeatUsageEvent(_ context.Context, _ database.Store, _ string, _ usagetypes.HeartbeatEvent) error

InsertHeartbeatUsageEvent is a no-op implementation of InsertHeartbeatUsageEvent.

type Inserter

type Inserter interface {
	// InsertDiscreteUsageEvent writes a discrete usage event to the database
	// within the given transaction.
	// The caller context must be authorized to create usage events in the
	// database.
	InsertDiscreteUsageEvent(ctx context.Context, tx database.Store, event usagetypes.DiscreteEvent) error

	// InsertHeartbeatUsageEvent writes a heartbeat usage event to the database
	// within the given transaction.
	//
	// The caller context must be authorized to create usage events in the database.
	//
	// The `id` should be a stable identifier for the event. Heartbeat events may be
	// emitted by multiple replicas of the same daemon, so the same logical event
	// may be submitted multiple times concurrently. For this reason the identifier
	// must be deterministic and stateless, allowing duplicate submissions to be
	// safely ignored.
	//
	// Inserts with the same `id` must be idempotent. The database enforces this by
	// ignoring duplicate records.
	InsertHeartbeatUsageEvent(ctx context.Context, tx database.Store, id string, event usagetypes.HeartbeatEvent) error
}

Inserter accepts usage events generated by the product.

func NewAGPLInserter

func NewAGPLInserter() Inserter

Directories

Path Synopsis
Package usagetypes contains the types for usage events.
Package usagetypes contains the types for usage events.

Jump to

Keyboard shortcuts

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