Documentation
¶
Overview ¶
Package pkgs contains functions for parsing remote urls and checking if a directory is a git repository.
Index ¶
- Variables
- func IsRemote(str string, shorts map[string]string) (expanded string, ok bool)
- func ListLocal(f fs.FS) ([]string, error)
- func ListSystem(f fs.FS) ([]string, error)
- func ParseRemote(urlStr string) (string, error)
- func Update(path string) (updated bool, err error)
- type AuthProvider
- type AuthProviderFunc
- type Cloner
- type ClonerFunc
- type Resolver
- type ResolverOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoMatchingScaffold = fmt.Errorf("no matching scaffold")
Functions ¶
func IsRemote ¶
IsRemote checks if the string is a remote url or an alias for a remote url if it is a remote url, it returns the url. If the string uses and alias it returns the expanded url
Examples:
isRemote(gh:foo/bar) -> https://github.com/foo/bar, true
func ListSystem ¶
ListSystem traverses the filesystem and returns a list of all the package paths and references. This lists only the system scaffolds, and not the ones in the local .scaffold directory.
func ParseRemote ¶
ParseRemote parses a remote endpoint and returns a filesystem path representing the repository.
Examples:
ParseRemote("https://github.com/hay-kot/scaffold-go-cli") github.com └── hay-kot └── scaffold-go-cli └── repository files
Types ¶
type AuthProvider ¶
type AuthProvider interface {
Authenticator(pkgurl string) (auth transport.AuthMethod, ok bool)
}
type AuthProviderFunc ¶
type AuthProviderFunc func(pkgurl string) (auth transport.AuthMethod, ok bool)
func (AuthProviderFunc) Authenticator ¶
func (f AuthProviderFunc) Authenticator(pkgurl string) (auth transport.AuthMethod, ok bool)
type ClonerFunc ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func NewResolver(shorts map[string]string, cache, cwd string, opts ...ResolverOption) *Resolver
type ResolverOption ¶
type ResolverOption func(*Resolver)
func WithCloner ¶
func WithCloner(cloner Cloner) ResolverOption
Click to show internal directories.
Click to hide internal directories.