Documentation ¶
Index ¶
Constants ¶
const ( // VersionHeader is sent in every telemetry request to // report the semantic version of Coder. VersionHeader = "X-Coder-Version" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKey ¶
type APIKey struct { ID string `json:"id"` UserID uuid.UUID `json:"user_id"` CreatedAt time.Time `json:"created_at"` LastUsed time.Time `json:"last_used"` LoginType database.LoginType `json:"login_type"` }
func ConvertAPIKey ¶
ConvertAPIKey anonymizes an API key.
type Deployment ¶
type Deployment struct { ID string `json:"id"` Architecture string `json:"architecture"` BuiltinPostgres bool `json:"builtin_postgres"` Containerized bool `json:"containerized"` Tunnel bool `json:"tunnel"` GitHubOAuth bool `json:"github_oauth"` Prometheus bool `json:"prometheus"` STUN bool `json:"stun"` OSType string `json:"os_type"` OSFamily string `json:"os_family"` OSPlatform string `json:"os_platform"` OSName string `json:"os_name"` OSVersion string `json:"os_version"` CPUCores int `json:"cpu_cores"` MemoryTotal uint64 `json:"memory_total"` MachineID string `json:"machine_id"` StartedAt time.Time `json:"started_at"` ShutdownAt *time.Time `json:"shutdown_at"` }
Deployment contains information about the host running Coder.
type ParameterSchema ¶
type ProvisionerJob ¶
type ProvisionerJob struct { ID uuid.UUID `json:"id"` OrganizationID uuid.UUID `json:"organization_id"` InitiatorID uuid.UUID `json:"initiator_id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` StartedAt *time.Time `json:"started_at,omitempty"` CanceledAt *time.Time `json:"canceled_at,omitempty"` CompletedAt *time.Time `json:"completed_at,omitempty"` Error string `json:"error"` Type database.ProvisionerJobType `json:"type"` }
func ConvertProvisionerJob ¶
func ConvertProvisionerJob(job database.ProvisionerJob) ProvisionerJob
ConvertProvisionerJob anonymizes a provisioner job.
type Reporter ¶
type Reporter interface { // Report sends a snapshot to the telemetry server. // The contents of the snapshot can be a partial representation of the // database. For example, if a new user is added, a snapshot can // contain just that user entry. Report(snapshot *Snapshot) Close() }
Reporter sends data to the telemetry server.
type Snapshot ¶
type Snapshot struct { DeploymentID string `json:"deployment_id"` APIKeys []APIKey `json:"api_keys"` ParameterSchemas []ParameterSchema `json:"parameter_schemas"` ProvisionerJobs []ProvisionerJob `json:"provisioner_jobs"` Templates []Template `json:"templates"` TemplateVersions []TemplateVersion `json:"template_versions"` Users []User `json:"users"` Workspaces []Workspace `json:"workspaces"` WorkspaceApps []WorkspaceApp `json:"workspace_apps"` WorkspaceAgents []WorkspaceAgent `json:"workspace_agents"` WorkspaceBuilds []WorkspaceBuild `json:"workspace_build"` WorkspaceResources []WorkspaceResource `json:"workspace_resources"` }
Snapshot represents a point-in-time anonymized database dump. Data is aggregated by latest on the server-side, so partial data can be sent without issue.
type Template ¶
type Template struct { ID uuid.UUID `json:"id"` CreatedBy uuid.UUID `json:"created_by"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` OrganizationID uuid.UUID `json:"organization_id"` Deleted bool `json:"deleted"` ActiveVersionID uuid.UUID `json:"active_version_id"` Name string `json:"name"` Description bool `json:"description"` }
func ConvertTemplate ¶
ConvertTemplate anonymizes a template.
type TemplateVersion ¶
type TemplateVersion struct { ID uuid.UUID `json:"id"` CreatedAt time.Time `json:"created_at"` TemplateID *uuid.UUID `json:"template_id,omitempty"` OrganizationID uuid.UUID `json:"organization_id"` JobID uuid.UUID `json:"job_id"` }
func ConvertTemplateVersion ¶
func ConvertTemplateVersion(version database.TemplateVersion) TemplateVersion
ConvertTemplateVersion anonymizes a template version.
type User ¶
type Workspace ¶
type Workspace struct { ID uuid.UUID `json:"id"` OrganizationID uuid.UUID `json:"organization_id"` OwnerID uuid.UUID `json:"owner_id"` TemplateID uuid.UUID `json:"template_id"` CreatedAt time.Time `json:"created_at"` Deleted bool `json:"deleted"` Name string `json:"name"` AutostartSchedule string `json:"autostart_schedule"` }
func ConvertWorkspace ¶
ConvertWorkspace anonymizes a workspace.
type WorkspaceAgent ¶
type WorkspaceAgent struct { ID uuid.UUID `json:"id"` CreatedAt time.Time `json:"created_at"` ResourceID uuid.UUID `json:"resource_id"` InstanceAuth bool `json:"instance_auth"` Architecture string `json:"architecture"` OperatingSystem string `json:"operating_system"` EnvironmentVariables bool `json:"environment_variables"` StartupScript bool `json:"startup_script"` Directory bool `json:"directory"` }
func ConvertWorkspaceAgent ¶
func ConvertWorkspaceAgent(agent database.WorkspaceAgent) WorkspaceAgent
ConvertWorkspaceAgent anonymizes a workspace agent.
type WorkspaceApp ¶
type WorkspaceApp struct { ID uuid.UUID `json:"id"` CreatedAt time.Time `json:"created_at"` AgentID uuid.UUID `json:"agent_id"` Icon string `json:"icon"` RelativePath bool `json:"relative_path"` }
func ConvertWorkspaceApp ¶
func ConvertWorkspaceApp(app database.WorkspaceApp) WorkspaceApp
ConvertWorkspaceApp anonymizes a workspace app.
type WorkspaceBuild ¶
type WorkspaceBuild struct { ID uuid.UUID `json:"id"` CreatedAt time.Time `json:"created_at"` WorkspaceID uuid.UUID `json:"workspace_id"` TemplateVersionID uuid.UUID `json:"template_version_id"` JobID uuid.UUID `json:"job_id"` BuildNumber uint32 `json:"build_number"` }
func ConvertWorkspaceBuild ¶
func ConvertWorkspaceBuild(build database.WorkspaceBuild) WorkspaceBuild
ConvertWorkspaceBuild anonymizes a workspace build.
type WorkspaceResource ¶
type WorkspaceResource struct { ID uuid.UUID `json:"id"` JobID uuid.UUID `json:"job_id"` Transition database.WorkspaceTransition `json:"transition"` Type string `json:"type"` }
func ConvertWorkspaceResource ¶
func ConvertWorkspaceResource(resource database.WorkspaceResource) WorkspaceResource
ConvertWorkspaceResource anonymizes a workspace resource.