usage

package
v2.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2025 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDBInserter

func NewDBInserter(opts ...InserterOption) agplusage.Inserter

NewDBInserter creates a new database-backed usage event inserter.

Types

type InserterOption

type InserterOption func(*dbInserter)

func InserterWithClock

func InserterWithClock(clock quartz.Clock) InserterOption

InserterWithClock sets the quartz clock to use for the inserter.

type Publisher

type Publisher interface {
	// Close closes the publisher and waits for it to finish.
	io.Closer
	// Start starts the publisher. It must only be called once.
	Start() error
}

Publisher publishes usage events ***somewhere***.

func NewTallymanPublisher

func NewTallymanPublisher(ctx context.Context, log slog.Logger, db database.Store, keys map[string]ed25519.PublicKey, opts ...TallymanPublisherOption) Publisher

NewTallymanPublisher creates a Publisher that publishes usage events to Coder's Tallyman service.

type TallymanPublisherOption

type TallymanPublisherOption func(*tallymanPublisher)

func PublisherWithClock

func PublisherWithClock(clock quartz.Clock) TallymanPublisherOption

PublisherWithClock sets the clock to use for publishing usage events.

func PublisherWithHTTPClient

func PublisherWithHTTPClient(httpClient *http.Client) TallymanPublisherOption

PublisherWithHTTPClient sets the HTTP client to use for publishing usage events.

func PublisherWithIngestURL

func PublisherWithIngestURL(ingestURL string) TallymanPublisherOption

PublisherWithIngestURL sets the ingest URL to use for publishing usage events.

func PublisherWithInitialDelay

func PublisherWithInitialDelay(initialDelay time.Duration) TallymanPublisherOption

PublisherWithInitialDelay sets the initial delay for the publisher.

Jump to

Keyboard shortcuts

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