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 Update(cacheRoot string, scaffoldPath string) (updated bool, err error)
- type AuthProvider
- type AuthProviderFunc
- type Cloner
- type ClonerFunc
- type Package
- type PackageList
- type Resolver
- type ResolverOption
- type Version
Constants ¶
This section is empty.
Variables ¶
var ErrNoMatchingScaffold = fmt.Errorf("no matching scaffold")
Functions ¶
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 Package ¶ added in v0.5.0
type Package struct { RemoteRef string Version string Subdir string // contains filtered or unexported fields }
func ParseRemote ¶
ParseRemote parses a remote endpoint and returns a filesystem path representing the repository. In addition, it returns the subdirectory of the repository to be used, if any.
Examples:
ParseRemote("https://github.com/hay-kot/scaffold-go-cli") github.com └── hay-kot └── scaffold-go-cli └── repository files ParseRemote("https://github.com/hay-kot/scaffold-go-cli#subdir") github.com └── hay-kot └── scaffold-go-cli └── subdir └── files to use
func (Package) CloneDir ¶ added in v0.5.0
CloneDir returns the directory where the repository will be cloned.
func (Package) ScaffoldDir ¶ added in v0.5.0
ScaffoldDir returns the directory where the repository will be cloned and the subdirectory to use if the package reference was specified with a subdirectory argument.
type PackageList ¶ added in v0.5.0
func ListSystem ¶
func ListSystem(f fs.FS) ([]PackageList, error)
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.
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