Documentation
¶
Overview ¶
Package metadata provides the persistent storage layer for GPUd metadata.
Index ¶
- Constants
- func CreateTableMetadata(ctx context.Context, dbRW *sql.DB) error
- func DeleteAllMetadata(ctx context.Context, dbRW *sql.DB) error
- func MaskToken(token string) string
- func ReadAllMetadata(ctx context.Context, dbRO *sql.DB) (map[string]string, error)
- func ReadMachineID(ctx context.Context, dbRO *sql.DB) (string, error)
- func ReadMetadata(ctx context.Context, dbRO *sql.DB, key string) (string, error)
- func ReadToken(ctx context.Context, dbRO *sql.DB) (string, error)
- func SetMetadata(ctx context.Context, dbRW *sql.DB, key string, value string) error
Constants ¶
const ( MetadataKeyMachineID = "machine_id" MetadataKeyToken = "token" MetadataKeyEndpoint = "endpoint" MetadataKeyPublicIP = "public_ip" MetadataKeyPrivateIP = "private_ip" // MetadataKeyControlPlaneLoginSuccess represents the timestamp in unix seconds // when the control plane login was successful. MetadataKeyControlPlaneLoginSuccess = "control_plane_login_success" )
Variables ¶
This section is empty.
Functions ¶
func CreateTableMetadata ¶
CreateTableMetadata creates the table for the metadata.
func DeleteAllMetadata ¶
DeleteAllMetadata purges all metadata entries from the primary metadata table.
func ReadAllMetadata ¶
ReadAllMetadata reads all the metadata entries. Returns an empty string and no error, if the metadata entry is not found.
func ReadMachineID ¶ added in v0.9.0
ReadMachineID returns the machine ID from the metadata table. Returns an empty string and no error if the machine ID is not present.
func ReadMetadata ¶
ReadMetadata reads the value of a metadata entry. Returns an empty string and no error, if the metadata entry is not found.
func ReadToken ¶ added in v0.9.0
ReadToken returns the token from the metadata table. Returns an empty string and no error if the token is not present.
func SetMetadata ¶
SetMetadata sets the value of a metadata entry. If the metadata entry is not found, it is created. If the metadata entry is found and the value is the same, it is not updated. If the metadata entry is found and the value is different, it is updated.
Types ¶
This section is empty.