userdata

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: BSD-3-Clause, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreateCmd

func NewCreateCmd() *cobra.Command

func NewDeleteCmd

func NewDeleteCmd() *cobra.Command

func NewGetCmd

func NewGetCmd() *cobra.Command

func NewListCmd

func NewListCmd() *cobra.Command

func NewUpdateCmd

func NewUpdateCmd() *cobra.Command

func RegisterContentFlags

func RegisterContentFlags(cmd *cobra.Command)

RegisterContentFlags adds the mutually-exclusive content flags.

func ResolveContent

func ResolveContent(cmd *cobra.Command) (string, bool)

ResolveContent returns the base64-encoded content to send to the API.

The API stores user data content base64-encoded. To keep the CLI friendly, --content takes plain text and is encoded here; --content-base64 takes a value that is already encoded and is passed through unchanged (useful for piping file contents that are not valid UTF-8 text on the shell).

It is shared with the project-scoped commands (cmd/projectuserdata), which operate on the same resource.

Types

type CreateUserDataOperation

type CreateUserDataOperation struct{}

type DeleteUserDataOperation

type DeleteUserDataOperation struct{}

type GetUserDataOperation

type GetUserDataOperation struct{}

type ListUserDataOperation

type ListUserDataOperation struct{}

type UpdateUserDataOperation

type UpdateUserDataOperation struct{}

type UserData

type UserData struct {
	components.UserDataProperties
}

UserData wraps the SDK's UserDataProperties so it can be rendered as a table row or serialized through the shared renderer. It backs both the account-scoped (`lsh user-data`) and project-scoped (`lsh projects user-data`) commands, which return the same underlying resource.

func (*UserData) DecodedContent

func (m *UserData) DecodedContent() string

DecodedContent returns the entry's content decoded from base64, falling back to the raw value when it is not valid base64.

func (*UserData) DetailFields

func (m *UserData) DetailFields() map[string]string

DetailFields exposes the fields shown only in the details view: the project association and the decoded cloud-init content.

func (*UserData) DetailView

func (m *UserData) DetailView() renderer.DetailView

DetailView describes how user data is titled in the interactive views.

func (*UserData) GetData

func (m *UserData) GetData() []renderer.ResponseData

func (*UserData) TableRow

func (m *UserData) TableRow() table.Row

TableRow renders the compact list columns. The (base64) content is left out on purpose — it is exposed decoded in the details view via DetailFields.

type UserDataList

type UserDataList struct {
	Data []*UserData
}

UserDataList is a renderable collection of user data entries.

func (*UserDataList) GetData

func (m *UserDataList) GetData() []renderer.ResponseData

Jump to

Keyboard shortcuts

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