helpers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ambulance   = "🚑"
	Exclamation = "❗"
	Bark        = "🚧"
	Loop        = "⭕"
	Lock        = "🔒"
	Question    = "❓"
	Skull       = "💀"
	VPN         = "🛡"
)

Variables

This section is empty.

Functions

func AddMachineCreateFlags added in v0.1.0

func AddMachineCreateFlags(cmd *cobra.Command, name string, completion *completion.Completion)

func AddMachineQueryFlags added in v0.1.0

func AddMachineQueryFlags(cmd *cobra.Command, completion *completion.Completion)

func AddressFamilyFromPrefixes added in v0.1.0

func AddressFamilyFromPrefixes(prefixes ...string) (*apiv2.NetworkAddressFamily, error)

func DecodeProject

func DecodeProject(encoded string) (string, string, error)

func EncodeProject

func EncodeProject(uuid, project string) string

func HumanizeDuration

func HumanizeDuration(duration time.Duration) string

func IPAddressFamilyToType added in v0.1.0

func IPAddressFamilyToType(af string) *apiv2.IPAddressFamily

func IPTypeToType added in v0.1.0

func IPTypeToType(t string) *apiv2.IPType

func ImageClassificationFromString

func ImageClassificationFromString(classification string) (apiv2.ImageClassification, error)

func ImageFeatureFromString

func ImageFeatureFromString(feature string) (*apiv2.ImageFeature, error)

func ImageFeaturesFromStringSlice

func ImageFeaturesFromStringSlice(features []string) ([]apiv2.ImageFeature, error)

func IsAnyViperFlagSet

func IsAnyViperFlagSet(names ...string) bool

func LabelsFromSlice

func LabelsFromSlice(labelSlice []string) (*apiv2.Labels, error)

LabelsFromSlice converts a given label slice (e.g. ["a=b"]) into apiv2 labels. When an empty slice is provided be aware that this function returns nil without an error.

func MachineCreateRequestFromCLI added in v0.1.0

func MachineCreateRequestFromCLI(c *config.Config) (*apiv2.MachineServiceCreateRequest, error)

func MachineListEmojiHelpText added in v0.1.0

func MachineListEmojiHelpText() string

func MachineQuery added in v0.1.0

func MachineQuery(unscoped bool) (*apiv2.MachineQuery, error)

MachineQuery returns a machine query from the cmd flags added through AddMachineQueryFlags unscoped indicates an unscoped request made from the admin API, which has certain effects on building the query

func MachineResponseToCreate added in v0.1.0

func MachineResponseToCreate(r *apiv2.Machine) (*apiv2.MachineServiceCreateRequest, error)

func MachineResponseToUpdate added in v0.1.0

func MachineResponseToUpdate(r *apiv2.Machine) (*apiv2.MachineServiceUpdateRequest, error)

func MachineUpdateRequestFromCLI added in v0.1.0

func MachineUpdateRequestFromCLI(c *config.Config, args []string) (*apiv2.MachineServiceUpdateRequest, error)

func NetworkAddressFamilyToType added in v0.1.0

func NetworkAddressFamilyToType(af string) *apiv2.NetworkAddressFamily

func SearchSSHKey added in v0.1.0

func SearchSSHKey() (string, error)

func ToAdminRole

func ToAdminRole(roleString string) (*apiv2.AdminRole, error)

func ToInfraRole

func ToInfraRole(roleString string) (*apiv2.InfraRole, error)

func ToMachineRoles

func ToMachineRoles(machineRolesSlice []string) (map[string]apiv2.MachineRole, error)

func ToPermissionsByVisibility

func ToPermissionsByVisibility(perms []*apiv2.MethodPermission) ([]*apiv2.PermissionsByVisibility, error)

func ToProjectRoles

func ToProjectRoles(projectRolesSlice []string) (map[string]apiv2.ProjectRole, error)

func ToTenantRoles

func ToTenantRoles(tenantRolesSlice []string) (map[string]apiv2.TenantRole, error)

func TrimProvider

func TrimProvider(subject string) string

func UpdateLabelsFromCLI

func UpdateLabelsFromCLI() (*apiv2.UpdateLabels, error)

UpdateLabelsFromCLI returns update labels from CLI args. Make sure you use --add-labels, --remove-labels and --labels in the command. Note that this function returns nil without an error in case none of the flags are used.

func UpdateLabelsFromMeta

func UpdateLabelsFromMeta(meta *apiv2.Meta) *apiv2.UpdateLabels

UpdateLabelsFromMeta returns update labels with replace strategy from a given meta.

func UpdateMetaFromMeta

func UpdateMetaFromMeta(meta *apiv2.Meta) *apiv2.UpdateMeta

UpdateMetaFromMeta returns an update for a given meta. When the updated at field is set, it uses client locking, otherwise server locking.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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