Documentation ¶
Index ¶
- func DownloadFile(url string) (response *http.Response, err error)
- func Extract(file string, extension string, dir string) (err error)
- func GetDeploySettingsFile(installDir string) string
- func StoreDeploySettings(file string, settings IDeploySettings) error
- type Asset
- type Checksums
- type GiteaDeploySettings
- type GithubDeploySettings
- type HTTPDeploySettings
- type IDeploySettings
- type LocalDeploySettings
- type RepoSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadFile ¶
DownloadFile downloads a file from a `url`. Response body needs to be closed by caller.
func GetDeploySettingsFile ¶
GetDeploySettingsFile gets the deploy settings file inside the install directory.
func StoreDeploySettings ¶
func StoreDeploySettings(file string, settings IDeploySettings) error
StoreDeploySettings stores the deploy `settings` to `file`.
Types ¶
type Asset ¶
type Asset struct { FileName string // The file name of the asset. URL string // The download URL of the asset. Extension string // Extension of the assert (can be empty). }
Asset holds data for Git web services such as Github or Gitea.
type GiteaDeploySettings ¶
type GiteaDeploySettings struct { RepoSettings APIUrl string // API url of the Gitea service. // If empty, the internal Githooks binary // embedded PGP is taken from `.deploy.pgp`. PublicPGP string }
GiteaDeploySettings are deploy settings for Gitea.
type GithubDeploySettings ¶
type GithubDeploySettings struct { RepoSettings // If empty, the internal Githooks binary // embedded PGP is taken from `.deploy.pgp`. PublicPGP string }
GithubDeploySettings are deploy settings for Github.
type HTTPDeploySettings ¶
type HTTPDeploySettings struct { // Path template string which can contain // - `{{VersionTag}}` : The version tag to download. // - `{{Version}}` : The version to download (removed prefix 'v' of `VersionTag`). // - `{{Os}}` : The `runtime.GOOS` variable with the operating system. // - `{{Arch}}` : The `runtime.GOARCH` for type architecture. // pointing to the compressed archive of the Githooks binaries. // In the same url directory need to be a checksum file // `githooks.checksums` // and a checksum signature file. // `githooks.checksums.sig` which is validated using // the `PublicPGP`. URLTemplate string // If empty, the internal Githooks binary // embedded PGP is taken from `.deploy.pgp`. PublicPGP string }
HTTPDeploySettings are deploy settings for HTTP downloading.
type IDeploySettings ¶
IDeploySettings is the common interface for all deploy settings.
func LoadDeploySettings ¶
func LoadDeploySettings(file string) (IDeploySettings, error)
LoadDeploySettings load the deploy settings from `file`.
type LocalDeploySettings ¶
type LocalDeploySettings struct { // Path template string which can contain // - `{{VersionTag}}` : The version tag to download. // - `{{Version}}` : The version to download (removed prefix 'v' of `VersionTag`). // - `{{Os}}` : The `runtime.GOOS` variable with the operating system. // - `{{Arch}}` : The `runtime.GOARCH` for type architecture. // pointing to the compressed archive of the Githooks binaries. // In the same directory need to be a checksum file // `githooks.checksums` // and a checksum signature file. // `githooks.checksums.sig` which is validated using // the `PublicPGP`. PathTemplate string // If empty, the internal Githooks binary // embedded PGP is taken from `.deploy.pgp`. PublicPGP string }
LocalDeploySettings are deploy settings for accessing the deploy locally.
type RepoSettings ¶
type RepoSettings struct { Owner string // The owner of the repository. Repository string // The repository name. }
RepoSettings holds repo data for web based Git services such as Github or Gitea.