analytics

package
v0.9.13 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SystemInfoCacheKey = "system_info_cache_key"
)

Variables

View Source
var (
	ErrAnalyticsDisabled = errors.New("analytics is disabled")
)

Functions

This section is empty.

Types

type AnalyticsData

type AnalyticsData struct {
	EnvironmentInfo *EnvironmentInfo          `json:"environment_info"`
	SystemInfo      *SystemInfo               `json:"system_info"`
	TransferStats   []TransferStatsByCurrency `json:"transfer_stats"`
}

func (AnalyticsData) ConvertToAdminModel

func (o AnalyticsData) ConvertToAdminModel() *admin_requests.AnalyticsData

type EnvironmentInfo

type EnvironmentInfo struct {
	BackendVersionHash    string `json:"backend_version_hash"`
	BackendVersionTag     string `json:"backend_version_tag"`
	ProcessingVersionHash string `json:"processing_version_hash"`
	ProcessingVersionTag  string `json:"processing_version_tag"`
	UpdaterVersionHash    string `json:"updater_version_hash"`
	UpdaterVersionTag     string `json:"updater_version_tag"`
}

type IAnalytics

type IAnalytics interface {
	GetSystemInfo(ctx context.Context) (*SystemInfo, error)
	GetTransferStatsByCurrency(ctx context.Context) ([]TransferStatsByCurrency, error)
	GetAnalyticsData(ctx context.Context) (*AnalyticsData, error)
	IsAnalyticsEnabled(ctx context.Context) (bool, error)
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(
	storage storage.IStorage,
	cache cache.ICache,
	settings setting.IRootSettings,
	adminGateway *admin_gateway.Service,
	processingSvc processing.IProcessingSystem,
	updaterSvc updater.IUpdateClient,
	appVersion, appHash string,
) *Service

func (*Service) GetAnalyticsData

func (s *Service) GetAnalyticsData(ctx context.Context) (*AnalyticsData, error)

func (*Service) GetEnvironmentInfo

func (s *Service) GetEnvironmentInfo(ctx context.Context) (*EnvironmentInfo, error)

func (*Service) GetSystemInfo

func (s *Service) GetSystemInfo(ctx context.Context) (*SystemInfo, error)

func (*Service) GetTransferStatsByCurrency

func (s *Service) GetTransferStatsByCurrency(ctx context.Context) ([]TransferStatsByCurrency, error)

func (*Service) IsAnalyticsEnabled

func (s *Service) IsAnalyticsEnabled(ctx context.Context) (bool, error)

type SystemInfo

type SystemInfo struct {
	OS             string    `json:"os"`
	Architecture   string    `json:"architecture"`
	Distribution   string    `json:"distribution"`
	Family         string    `json:"family"`
	IsVM           bool      `json:"is_vm"`
	Version        string    `json:"version"`
	GoVersion      string    `json:"go_version"`
	CollectionTime time.Time `json:"collection_time"`
}

type TransferStatsByCurrency

type TransferStatsByCurrency struct {
	CurrencyID     string          `json:"currency_id"`
	CurrencyCode   string          `json:"currency_code"`
	TotalCount     int64           `json:"total_count"`
	TotalAmount    decimal.Decimal `json:"total_amount"`
	TotalAmountUSD decimal.Decimal `json:"total_amount_usd"`
}

Jump to

Keyboard shortcuts

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