Documentation
¶
Index ¶
Constants ¶
View Source
const (
// set this env var to the string "true" to prevent usage from being reported
DisableUsageVar = "DISABLE_USAGE_REPORTING"
TestingUrl = "localhost:3000"
)
Variables ¶
This section is empty.
Functions ¶
func IsReportingError ¶
func IsReportingError(err error) bool
func NewUsageClient ¶
func NewUsageClient(usageServerUrl string, usagePayloadReader UsagePayloadReader, product *api.Product, signatureManager signature.SignatureManager) *client
Types ¶
type Client ¶
type Client interface {
StartReportingUsage(ctx context.Context, interval time.Duration) <-chan error
}
type CloseableConnection ¶ added in v0.0.2
type CloseableConnection interface {
Close() error
}
type ReportingError ¶
type ReportingError struct {
// contains filtered or unexported fields
}
func ErrorConnecting ¶
func ErrorConnecting(err error) *ReportingError
func ErrorGettingSignature ¶ added in v0.1.0
func ErrorGettingSignature(err error) *ReportingError
func ErrorReadingPayload ¶
func ErrorReadingPayload(err error) *ReportingError
func ErrorSendingUsage ¶
func ErrorSendingUsage(err error) *ReportingError
type ReportingServiceClientBuilder ¶
type ReportingServiceClientBuilder func() (api.ReportingServiceClient, CloseableConnection, error)
type UsagePayloadReader ¶
type UsagePayloadReader interface {
GetPayload(ctx context.Context) (map[string]string, error)
}
a type that knows how to load the usage payload you want to report
Click to show internal directories.
Click to hide internal directories.