usagestats

package
v0.0.85-test Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: AGPL-3.0 Imports: 4 Imported by: 72

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricsFunc

type MetricsFunc func(context.Context) (map[string]interface{}, error)

type Report

type Report struct {
	Version         string                 `json:"version"`
	Metrics         map[string]interface{} `json:"metrics"`
	Os              string                 `json:"os"`
	Arch            string                 `json:"arch"`
	Edition         string                 `json:"edition"`
	HasValidLicense bool                   `json:"hasValidLicense"`
	Packaging       string                 `json:"packaging"`
	UsageStatsId    string                 `json:"usageStatsId"`
}

type SendReportCallbackFunc

type SendReportCallbackFunc func()

type Service

type Service interface {
	GetUsageReport(context.Context) (Report, error)
	RegisterMetricsFunc(MetricsFunc)
	RegisterSendReportCallback(SendReportCallbackFunc)
	ShouldBeReported(context.Context, string) bool
}

type UsageStatsMock

type UsageStatsMock struct {
	T testing.TB
	// contains filtered or unexported fields
}

func (*UsageStatsMock) GetUsageReport

func (usm *UsageStatsMock) GetUsageReport(ctx context.Context) (Report, error)

func (*UsageStatsMock) RegisterMetricsFunc

func (usm *UsageStatsMock) RegisterMetricsFunc(fn MetricsFunc)

func (*UsageStatsMock) RegisterSendReportCallback

func (usm *UsageStatsMock) RegisterSendReportCallback(_ SendReportCallbackFunc)

func (*UsageStatsMock) ShouldBeReported

func (usm *UsageStatsMock) ShouldBeReported(_ context.Context, s string) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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