agentseed

package
v0.43.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

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 agent_seed.json If left empty it will default to $APPDATA or /tmp A unique agent seed will be generated when this method is first called, and reused for the lifetime of this agent.

Types

type AgentSeed

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

AgentSeed identifies a unique agent

func Get

func Get() *AgentSeed

Get will return a unique agent seed for this agent. 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