http

package
v0.0.0-...-f22496c Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const TypeName = "go2chef.source.http"

TypeName is the name of this source plugin

Variables

This section is empty.

Functions

func Loader

func Loader(config map[string]interface{}) (go2chef.Source, error)

Loader implements SourceLoader for plugin registration

Types

type Source

type Source struct {
	SourceName       string `mapstructure:"name"`
	Method           string `mapstructure:"http_method"`
	URL              string `mapstructure:"url"`
	ValidStatusCodes []int  `mapstructure:"valid_status_codes"`
	Archive          bool   `mapstructure:"archive"`
	OutputFilename   string `mapstructure:"output_filename"`
	SHA256           string `mapstructure:"sha256"`
	// contains filtered or unexported fields
}

Source implements an HTTP source for resource downloads

func (*Source) DownloadToPath

func (s *Source) DownloadToPath(dlPath string) (err error)

DownloadToPath downloads a file over HTTP to a given path, handling archive extraction if the Source.Archive parameter is true.

func (*Source) Name

func (s *Source) Name() string

Name returns the name of this source

func (*Source) SetName

func (s *Source) SetName(n string)

SetName sets the name of this source

func (*Source) String

func (s *Source) String() string

String returns a string representation of this

func (*Source) Type

func (s *Source) Type() string

Type returns "http"

Jump to

Keyboard shortcuts

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