Documentation
¶
Index ¶
Constants ¶
const ( // EndpointAnalyticsJSON is the endpoint for analytics in JSON format EndpointAnalyticsJSON = "/analytics.json" // EndpointAnalyticsCSV is the endpoint for analytics in CSV format EndpointAnalyticsCSV = "/analytics.csv" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analytic ¶
type Analytic struct {
Device string `json:"device"`
Command string `json:"command"`
LastRun time.Time `json:"last_run"`
Count int `json:"count"`
}
Analytic represents a single analytics entry
type AnalyticsResponse ¶
type AnalyticsResponse []Analytic
AnalyticsResponse is the response from GET /analytics.json
type AnalyticsServiceInterface ¶
type AnalyticsServiceInterface interface {
// ListAnalytics returns a list of analytics data showing command usage statistics per device
//
// Returns analytics records with device, command, last run timestamp, and count information
ListAnalytics(ctx context.Context) (*AnalyticsResponse, *interfaces.Response, error)
// ListAnalyticsCSV returns a list of analytics data in CSV format
//
// Returns the same analytics data as ListAnalytics but formatted as CSV
ListAnalyticsCSV(ctx context.Context) ([]byte, *interfaces.Response, error)
}
AnalyticsServiceInterface defines the interface for analytics operations
Workbrew API docs: https://console.workbrew.com/documentation/api
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles communication with the analytics related methods of the Workbrew API.
Workbrew API docs: https://console.workbrew.com/documentation/api
func NewService ¶
func NewService(client interfaces.HTTPClient) *Service
NewService creates a new analytics service
func (*Service) ListAnalytics ¶
func (s *Service) ListAnalytics(ctx context.Context) (*AnalyticsResponse, *interfaces.Response, error)
ListAnalytics retrieves all analytics in JSON format URL: GET https://console.workbrew.com/workspaces/{workspace_name}/analytics.json
func (*Service) ListAnalyticsCSV ¶
ListAnalyticsCSV retrieves all analytics in CSV format URL: GET https://console.workbrew.com/workspaces/{workspace_name}/analytics.csv