util

package
v0.12.1-rc.3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMoreThanOneArgs = errors.New("more than one args are not accepted")
	ErrEmptyName       = errors.New("empty workspace name")
	ErrInvalidDefault  = errors.New("invalid default workspace")
	ErrEmptyFilePath   = errors.New("empty configuration file path")
)

Functions

func GetNameFromArgs

func GetNameFromArgs(args []string) (string, error)

GetNameFromArgs returns workspace name specified by args.

func GetValidWorkspaceFromFile

func GetValidWorkspaceFromFile(filePath, name string) (*v1.Workspace, error)

GetValidWorkspaceFromFile gets valid and structured workspace form file.

func ValidateFilePath

func ValidateFilePath(filePath string) error

ValidateFilePath returns the configuration file path is valid or not.

func ValidateName

func ValidateName(name string) error

ValidateName returns the workspace name is valid or not, which is used for getting and updating workspace.

func ValidateNotDefaultName added in v0.11.0

func ValidateNotDefaultName(name string) error

ValidateNotDefaultName returns true if ValidateName is true and the workspace name is not default, which is used for creating and deleting workspace.

Types

This section is empty.

Jump to

Keyboard shortcuts

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