reporter

package
v0.3.0-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// HashBits is Number of zero bits
	HashBits = 20
	// SaltLen is Random salt length
	SaltLen = 40
	// DefaultExtension Extension to add to the minted stamp
	DefaultExtension = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Minter

type Minter interface {
	Mint(string) (string, error)
}

Minter a interface that creates Hashcash stamp

type Reporter

type Reporter interface {
	// SingleReport represents send one report to the usage server
	// Types that are assignable to usageData:
	//	*usagePB.SessionReport_MgmtUsageData
	//	*usagePB.SessionReport_ConnectorUsageData
	//	*usagePB.SessionReport_ModelUsageData
	//	*usagePB.SessionReport_PipelineUsageData
	SingleReport(ctx context.Context, service usagePB.Session_Service, edition, version string, ownerUid string, usageData interface{}) error
	// Report sends report to the server regularly based on the report frequency
	// retrieveUsageData is a function that outputs any of the type:
	//	*usagePB.SessionReport_MgmtUsageData
	//	*usagePB.SessionReport_ConnectorUsageData
	//	*usagePB.SessionReport_ModelUsageData
	//	*usagePB.SessionReport_PipelineUsageData
	Report(ctx context.Context, service usagePB.Session_Service, edition, version string, ownerUid string, retrieveUsageData func() interface{})
}

Reporter interface

func NewReporter

func NewReporter(ctx context.Context, client usagePB.UsageServiceClient, service usagePB.Session_Service, edition, version string, defaultOwnerUid string) (Reporter, error)

NewReporter creates a new usage reporter

Jump to

Keyboard shortcuts

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