taskutil

package
v1.17.8 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultMetadataTimeout = 5 * time.Minute

	MetadataAPIURLEnvName = "METADATA_API_URL"
)

Variables

This section is empty.

Functions

func Fetch

func Fetch(revision, path, url string) error

Fetch fetches the specified git repository at the revision into path.

func LoadData added in v1.17.1

func LoadData(c *http.Client, u *url.URL, timeout time.Duration) (interface{}, error)

func LoadEnvironment added in v1.17.1

func LoadEnvironment(opts DefaultPlanOptions) (interface{}, error)

func MetadataSpecURL

func MetadataSpecURL() (string, error)

func MetadataURL added in v1.17.1

func MetadataURL(subpath string) (string, error)

func PopulateSpecFromDefaultPlan

func PopulateSpecFromDefaultPlan(target interface{}, opts DefaultPlanOptions) error

func SSHKeyScan

func SSHKeyScan(domain string) ([]byte, error)

func TreeFromDefaultPlan

func TreeFromDefaultPlan(opts DefaultPlanOptions) (interface{}, error)

func WriteDataToFile

func WriteDataToFile(file string, data []byte) error

func WriteToFile

func WriteToFile(file, content string) error

Types

type Decoder added in v1.17.1

type Decoder interface {
	Decode(io.Reader) (interface{}, error)
}

type DefaultPlanOptions

type DefaultPlanOptions struct {
	Client      *http.Client
	SpecURL     string
	SpecPath    string
	SpecTimeout time.Duration
}

type Loader added in v1.17.1

type Loader interface {
	Load() (io.Reader, error)
}

type LocalLoader added in v1.17.1

type LocalLoader struct {
	// contains filtered or unexported fields
}

func NewLocalLoader added in v1.17.1

func NewLocalLoader(path string) LocalLoader

func (LocalLoader) Load added in v1.17.1

func (l LocalLoader) Load() (io.Reader, error)

type RemoteLoader added in v1.17.1

type RemoteLoader struct {
	// contains filtered or unexported fields
}

func NewRemoteLoader added in v1.17.1

func NewRemoteLoader(u *url.URL, client *http.Client) RemoteLoader

func (RemoteLoader) Load added in v1.17.1

func (r RemoteLoader) Load() (io.Reader, error)

type SSHConfig

type SSHConfig struct {
	Entries map[string]SSHEntry
	Order   []string
}

func (*SSHConfig) String

func (dc *SSHConfig) String() string

func (*SSHConfig) Write

func (dc *SSHConfig) Write() error

type SSHEntry

type SSHEntry struct {
	Name       string
	PrivateKey string
	KnownHosts string
}

func (*SSHEntry) Write

func (be *SSHEntry) Write(sshDir string) error

Jump to

Keyboard shortcuts

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