getter_helper

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadTemplatesToTemporaryFolder

func DownloadTemplatesToTemporaryFolder(templateUrl string) (string, string, error)

DownloadTemplatesToTemporaryFolder uses the go-getter library to fetch the templates from the configured URL to a temporary folder and returns the path to that folder. If there is a subdir in the template URL, return the combined path as well.

func NewGetterClient

func NewGetterClient(src string, dst string) (*getter.Client, error)

We use this code to force go-getter to copy files instead of creating symlinks.

func ParseGetterUrl

func ParseGetterUrl(templateUrl string) (*url.URL, error)

func ValidateTemplateUrl

func ValidateTemplateUrl(templateUrl string) error

ValidateTemplateUrl returns an error if the template URL is not following one of the supported detector patterns.

Types

type FileCopyGetter

type FileCopyGetter struct {
	getter.FileGetter
}

A custom getter.Getter implementation that uses file copying instead of symlinks. Symlinks are faster and use less disk space, but they cause issues in Windows and with infinite loops, so we copy files/folders instead.

func (*FileCopyGetter) Get

func (g *FileCopyGetter) Get(dst string, u *url.URL) error

The original FileGetter does NOT know how to do folder copying (it only does symlinks), so we provide a copy implementation here

func (*FileCopyGetter) GetFile

func (g *FileCopyGetter) GetFile(dst string, u *url.URL) error

The original FileGetter already knows how to do file copying so long as we set the Copy flag to true, so just delegate to it

Jump to

Keyboard shortcuts

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