fetch

package
v0.0.0-...-7f6a8a6 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchArchive

func FetchArchive(archiveName string) string

Types

type Data

type Data struct {
	Repository Repository `json:"repository"`
}

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient defines the client inerface for test mocks

var Client HTTPClient

Client is an HTTPClient, defined here to enable mocking

type Node

type Node struct {
	Name string `json:"name"`
}

type QueryResult

type QueryResult struct {
	Data Data `json:"data"`
}

type Refs

type Refs struct {
	Nodes []Node `json:"nodes"`
}

type Report

type Report struct {
	Os      string
	Arch    string
	Version string
	Archive string
}

func BuildReport

func BuildReport(pwd string) Report

BuildReport is the primary runner for the application. It compiles all information needed to select a golang install package, based on current os, architecture, and the go version from go.mod. Then it downloads the selected file and installs it into a shim directory, modifies the PATH for the current process, and prints a message for the user to suggest a PATH export to add to the shell profile

type Repository

type Repository struct {
	Refs Refs `json:"refs"`
}

Jump to

Keyboard shortcuts

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