wget

package
v0.0.0-...-877fc11 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Type   = "wget"
	TypeV1 = Type + runtime.VersionSeparator + "v1"
)

Type is the access type for a blob on an http server .

Variables

View Source
var REALM = ocmlog.DefineSubRealm("access method for wget", "accessmethod/wget")

Functions

func AddConfig

func AddConfig(opts flagsets.ConfigOptions, config flagsets.Config) error

func Is

func Is(spec accspeccpi.AccessSpec) bool

func Logger

func Logger(c ContextProvider, keyValuePairs ...interface{}) logging.Logger

Types

type AccessSpec

type AccessSpec struct {
	runtime.ObjectVersionedType `json:",inline"`

	// URLs to the files on a server
	URL string `json:"URL"`
	// MediaType is the media type of the object represented by the blob
	MediaType string `json:"mediaType"`
	// Header to be passed in the http request
	Header map[string][]string `json:"header"`
	// Verb is the http verb to be used for the request
	Verb string `json:"verb"`
	// Body is the body to be included in the http request
	Body io.Reader `json:"body"`
	// NoRedirect allows to disable redirects
	NoRedirect bool `json:"noRedirect"`
}

AccessSpec describes the access for files on HTTP and HTTPS servers.

func New

func New(url string, opts ...Option) *AccessSpec

New creates a new WGET accessor for http resources.

func (*AccessSpec) AccessMethod

func (*AccessSpec) Describe

func (a *AccessSpec) Describe(ctx accspeccpi.Context) string

func (*AccessSpec) GetInexpensiveContentVersionIdentity

func (a *AccessSpec) GetInexpensiveContentVersionIdentity(access accspeccpi.ComponentVersionAccess) string

func (*AccessSpec) GetURL

func (a *AccessSpec) GetURL() string

func (*AccessSpec) GlobalAccessSpec

func (a *AccessSpec) GlobalAccessSpec(ctx accspeccpi.Context) accspeccpi.AccessSpec

func (*AccessSpec) IsLocal

func (a *AccessSpec) IsLocal(ctx accspeccpi.Context) bool

type ContextProvider

type ContextProvider interface {
	GetContext() cpi.Context
}

type Option

type Option = wget.Option

func WithBody

func WithBody(v io.Reader) Option

func WithHeader

func WithHeader(h http.Header) Option

func WithMimeType

func WithMimeType(mime string) Option

func WithNoRedirect

func WithNoRedirect(r ...bool) Option

func WithVerb

func WithVerb(v string) Option

type Options

type Options = wget.Options

Jump to

Keyboard shortcuts

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