clientid

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package clientid stores a random identifier for a local CLI installation.

Index

Constants

View Source
const HeaderName = "X-Client-Id"

HeaderName identifies a local CLI installation in outgoing HTTP requests.

Variables

This section is empty.

Functions

func LoadOrCreate

func LoadOrCreate(directory string) (string, error)

LoadOrCreate returns the UUIDv4 stored in directory/client_id. The ID is independent of credentials, profiles, and CLI versions. It is never silently replaced: an unreadable or invalid existing file is an error.

A fully written temporary file is published with an atomic, non-replacing hard link. Concurrent first callers, including separate processes, all use the winning file; no caller can observe a partially written ID. The directory must support hard links when creating an ID for the first time.

Types

This section is empty.

Jump to

Keyboard shortcuts

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