Documentation
¶
Index ¶
- Variables
- func FormatField(s string) string
- func GetDatabase(ctx context.Context, identifier string, nc rig.Client) (*database.Database, string, error)
- func GetGroup(ctx context.Context, identifier string, nc rig.Client) (*group.Group, string, error)
- func GetPasswordPrompt(label string) (string, error)
- func GetStorageProvider(ctx context.Context, identifier string, nc rig.Client) (*storage.Provider, string, error)
- func GetUser(ctx context.Context, identifier string, nc rig.Client) (*user.User, string, error)
- func GetUserAndPasswordUpdates(username, email, phoneNumber, password string) ([]*user.Update, error)
- func GetUserIdentifier(username, email, phoneNumber string) (*model.UserIdentifier, error)
- func GetUserIdentifierUpdates(username, email, phoneNumber string) ([]*user.Update, error)
- func ParseUserIdentifier(identifier string) (*model.UserIdentifier, error)
- func ParseUserIdentifierUpdate(identifier string) (*user.Update, error)
- func PromptConfirm(label string, def bool) (bool, error)
- func PromptGetInput(label string, validate func(input string) error) (string, error)
- func PromptGetInputWithDefault(label string, validate func(input string) error, def string) (string, error)
- func PromptSelect(label string, items []string, hideSelected bool) (int, string, error)
- func PromptUserIndentifier() (*model.UserIdentifier, error)
- func PromptUserIndentifierUpdate() (*user.Update, error)
- func ProtoToPrettyJson(m protoreflect.ProtoMessage) string
Constants ¶
This section is empty.
Variables ¶
View Source
var BoolValidate = func(bool string) error { if bool != "true" && bool != "false" { return errors.InvalidArgumentErrorf("invalid boolean value") } return nil }
View Source
var GetInputTemplates = &promptui.PromptTemplates{
Prompt: "{{ . }} ",
Valid: "{{ . | green }} ",
Invalid: "{{ . | red }} ",
Success: "{{ . | bold }} ",
}
View Source
var ValidateAll = func(input string) error { return nil }
View Source
var ValidateEmail = func(input string) error { _, err := mail.ParseAddress(input) if err != nil { return err } return nil }
View Source
var ValidateImage = func(input string) error { _, err := reference.ParseDockerRef(input) if err != nil { return err } return nil }
View Source
var ValidateInt = func(input string) error { _, err := strconv.Atoi(input) if err != nil { return err } return nil }
View Source
var ValidateNonEmpty = func(input string) error { if input == "" { return errors.InvalidArgumentErrorf("value cannot be empty") } return nil }
View Source
var ValidateSystemName = func(input string) error { if l := len(input); l < 3 || l > 63 { return errors.InvalidArgumentErrorf("must be between 3 and 63 characters long") } if !regexp.MustCompile(`^[a-z][a-z0-9-]+[a-z0-9]$`).MatchString(input) { return errors.InvalidArgumentErrorf("invalid name; can only contain a-z, 0-9 and '-'") } return nil }
View Source
var ValidateURL = func(input string) error { _, err := url.Parse(input) return err }
Functions ¶
func FormatField ¶
func GetDatabase ¶
func GetPasswordPrompt ¶
func GetStorageProvider ¶
func GetUserIdentifier ¶
func GetUserIdentifier(username, email, phoneNumber string) (*model.UserIdentifier, error)
func ParseUserIdentifier ¶
func ParseUserIdentifier(identifier string) (*model.UserIdentifier, error)
func PromptGetInput ¶
func PromptSelect ¶
func PromptUserIndentifier ¶
func PromptUserIndentifier() (*model.UserIdentifier, error)
func ProtoToPrettyJson ¶
func ProtoToPrettyJson(m protoreflect.ProtoMessage) string
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.