identity

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Identity

type Identity struct {
	OS         string    `json:"os"`
	Username   string    `json:"username,omitempty"`
	UID        string    `json:"uid,omitempty"`
	Groups     []string  `json:"groups,omitempty"`
	IsRoot     bool      `json:"is_root"`
	DetectedAt time.Time `json:"detected_at"`
}

func Detect

func Detect(ctx context.Context) (Identity, error)

func GetOrDetect

func GetOrDetect(ctx context.Context, opt Options) (Identity, error)

type Options

type Options struct {
	MaxAge time.Duration
}

Options allows customizing cache behavior. If MaxAge<=0, a default is used.

Source Files

  • identity.go

Jump to

Keyboard shortcuts

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