client

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: Apache-2.0 Imports: 11 Imported by: 3

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

func (*ReportingError) Error

func (r *ReportingError) Error() string

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

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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