Documentation
¶
Overview ¶
Package agentstate centralizes access to local persisted agent state.
Index ¶
Constants ¶
View Source
const ( MetadataKeyBackendBaseURL = "backend_base_url" MetadataKeySAKToken = "sak_token" MetadataKeyEnrolledAt = "enrolled_at" MetadataKeyNodeGroup = "node_group" MetadataKeyComputeZone = "compute_zone" )
Variables ¶
This section is empty.
Functions ¶
func GetOrCreateNodeUUIDMetadata ¶ added in v1.3.1
func GetOrCreateNodeUUIDMetadata(ctx context.Context, db *sql.DB, create func() (string, error)) (string, bool, error)
GetOrCreateNodeUUIDMetadata atomically returns the committed node UUID metadata value, creating it when missing or repairing an empty value.
Types ¶
type State ¶
type State interface {
GetBackendBaseURL(ctx context.Context) (value string, ok bool, err error)
SetBackendBaseURL(ctx context.Context, value string) error
GetJWT(ctx context.Context) (value string, ok bool, err error)
SetJWT(ctx context.Context, value string) error
GetSAK(ctx context.Context) (value string, ok bool, err error)
SetSAK(ctx context.Context, value string) error
// GetNodeUUID reads the committed node UUID without creating one.
GetNodeUUID(ctx context.Context) (value string, ok bool, err error)
SetNodeUUID(ctx context.Context, value string) error
// GetOrCreateNodeUUID creates and commits the node UUID when no value exists.
GetOrCreateNodeUUID(ctx context.Context, create func() (string, error)) (value string, created bool, err error)
GetEnrollmentTime(ctx context.Context) (value time.Time, ok bool, err error)
SetEnrollmentTime(ctx context.Context, value time.Time) error
GetNodeGroup(ctx context.Context) (value string, ok bool, err error)
SetNodeGroup(ctx context.Context, value string) error
GetComputeZone(ctx context.Context) (value string, ok bool, err error)
SetComputeZone(ctx context.Context, value string) error
}
State provides local persisted metadata/state access for backend workflows.
Click to show internal directories.
Click to hide internal directories.