alloyseed

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LegacyHeaderName = "X-Agent-Id" // LegacyHeaderName represents the header name used prior to the Alloy release.
	HeaderName       = "X-Alloy-Id" // HeaderName represents the ID header to use for Alloy.
)

Variables

This section is empty.

Functions

func Init

func Init(dir string, l log.Logger)

Init should be called by an app entrypoint as soon as it can to configure where the unique seed will be stored. dir is the directory where we will read and store alloy_seed.json If left empty it will default to $APPDATA or /tmp A unique Alloy seed will be generated when this method is first called, and reused for the lifetime of this Alloy instance.

Types

type Seed

type Seed struct {
	UID       string    `json:"UID"`
	CreatedAt time.Time `json:"created_at"`
	Version   string    `json:"version"`
}

Seed identifies a unique Alloy instance.

func Get

func Get() *Seed

Get returns a unique seed for this Alloy instance. It will always return a valid seed, even if previous attempts to load or save the seed file have failed

Jump to

Keyboard shortcuts

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