usage.go
usage.go - Overview
- Overview
This file defines the data structures for representing usage information, including the payload structure for receiving usage data and the structure for storing usage data in the database.
- Detailed Documentation
UsagePayload
- Purpose: Represents the payload structure for transmitting usage data.
- Parameters:
InstallationId
(uuid.UUID): The unique identifier of the installation.LicenseKey
(uuid.UUID): The license key associated with the usage data.Usage
([]Usage): A slice ofUsage
structs representing the actual usage information.
- Returns: None
Usage
- Purpose: Represents a single usage record.
- Parameters:
CollectorID
(string): The ID of the collector.ExporterID
(string): The ID of the exporter.Type
(string): The type of usage.Tenant
(string): The tenant associated with the usage.TimeStamp
(time.Time): The timestamp of the usage record.Count
(int64): A count associated with the usage.Size
(int64): The size associated with the usage.OrgName
(string): The organization name associated with the usage.TenantId
(string): The tenant ID associated with the usage.
- Returns: None
UsageDB
- Purpose: Represents the structure for storing usage data in the database.
- Parameters:
CollectorID
(string): The ID of the collector.ch:"collector_id"
: Specifies the column name in the ClickHouse database.
ExporterID
(string): The ID of the exporter.ch:"exporter_id"
: Specifies the column name in the ClickHouse database.
Type
(string): The type of usage. This field is excluded from ClickHouse (ch:"-"
).TimeStamp
(time.Time): The timestamp of the usage record.ch:"timestamp"
: Specifies the column name in the ClickHouse database.
Tenant
(string): The tenant associated with the usage.Data
(string): A string containing additional usage data.ch:"data"
: Specifies the column name in the ClickHouse database.
- Returns: None
- Code Examples
None
- Clarity and Accuracy
The documentation accurately reflects the code.
- Markdown & MDX Perfection
The markdown syntax is correct.
- Edge Cases To Avoid Breaking MDX
No issues found.
- Getting Started Relevance
Include in Getting Started: NO