Documentation
¶
Index ¶
- func AbsPathWithExpansion(p string) (string, error)
- func ArgToIndex(arg string) (int64, error)
- func ArgsToIndices(args []string) ([]int64, error)
- func Contains(haystack []string, needle string) bool
- func DirExists(path string) (bool, error)
- func FileExist(fileName string) (bool, error)
- func GetOwnerAndRepo(repoPath, user string) (string, string)
- func IndexOf(haystack []string, needle string) int
- func IsKeyEncrypted(sshKey string) (bool, error)
- func NormalizeURL(raw string) (*url.URL, error)
- func PathExists(path string) (bool, error)
- func ReadValue(cmd *cli.Command, opts ReadValueOptions) (string, error)
- func ValidateAuthenticationMethod(giteaURL string, token string, user string, passwd string, sshAgent bool, ...) (*url.URL, error)
- type ReadValueOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbsPathWithExpansion ¶ added in v0.6.0
AbsPathWithExpansion expand path beginning with "~/" to absolute path
func ArgToIndex ¶ added in v0.6.0
ArgToIndex take issue/pull index as string and return int64
func ArgsToIndices ¶ added in v0.10.0
ArgsToIndices take issue/pull index as string and returns int64s
func GetOwnerAndRepo ¶ added in v0.6.0
GetOwnerAndRepo return repoOwner and repoName based on relative path and default owner (if not in path)
func IsKeyEncrypted ¶ added in v0.10.0
IsKeyEncrypted checks if the key is encrypted
func NormalizeURL ¶ added in v0.6.0
NormalizeURL normalizes the input with a protocol
func PathExists ¶ added in v0.5.0
PathExists returns whether the given file or directory exists or not
func ReadValue ¶ added in v0.12.0
func ReadValue(cmd *cli.Command, opts ReadValueOptions) (string, error)
ReadValue reads a value from various sources in the following priority order: 1. From a file specified by --file flag 2. From stdin if --stdin flag is set 3. From command arguments (second argument) 4. Interactive prompt
func ValidateAuthenticationMethod ¶ added in v0.11.0
func ValidateAuthenticationMethod( giteaURL string, token string, user string, passwd string, sshAgent bool, sshKey string, sshCertPrincipal string, ) (*url.URL, error)
ValidateAuthenticationMethod checks the provided authentication method parameters
Types ¶
type ReadValueOptions ¶ added in v0.12.0
type ReadValueOptions struct {
// ResourceName is the name of the resource (e.g., "secret", "variable")
ResourceName string
// PromptMsg is the message to display when prompting interactively
PromptMsg string
// Hidden determines if the input should be hidden (for secrets/passwords)
Hidden bool
// AllowEmpty determines if empty values are allowed
AllowEmpty bool
}
ReadValueOptions contains options for reading a value from various sources