wget

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CACHE_CONTENT_THRESHOLD = 4096
)

Variables

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

Functions

func BlobAccess added in v0.12.0

func BlobAccess(url string, opts ...Option) (_ bpi.BlobAccess, rerr error)

func BlobAccessForWget

func BlobAccessForWget(url string, opts ...Option) (_ bpi.BlobAccess, rerr error)

BlobAccessForWget returns a BlobAccess for the given URL. Deprecated: use BlobAccess.

func BlobAccessProviderForWget

func BlobAccessProviderForWget(url string, opts ...Option) bpi.BlobAccessProvider

BlobAccessProviderForWget returns a BlobAccessProvider for the given URL. Deprecated: use Provider.

func DataAccess added in v0.12.0

func DataAccess(url string, opts ...Option) (bpi.DataAccess, error)

func DataAccessForWget

func DataAccessForWget(url string, opts ...Option) (bpi.DataAccess, error)

DataAccessForWget returns a DataAccess for the given URL. Deprecated: use DataAccess.

func Provider added in v0.12.0

func Provider(url string, opts ...Option) bpi.BlobAccessProvider

Types

type Option

type Option = optionutils.Option[*Options]

func WithBody

func WithBody(v io.Reader) Option

func WithCredentialContext

func WithCredentialContext(ctx credentials.ContextProvider) Option

func WithCredentials

func WithCredentials(c credentials.Credentials) Option

func WithHeader

func WithHeader(h http.Header) Option

func WithLoggingContext

func WithLoggingContext(ctx logging.ContextProvider) 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 struct {
	CredentialContext credentials.Context
	LoggingContext    logging.Context
	// Header to be passed in the http request
	Header http.Header
	// Verb is the http verb to be used for the request
	Verb string
	// Body is the body to be included in the http request
	Body io.Reader
	// NoRedirect allows to disable redirects
	NoRedirect *bool
	// MimeType defines the media type of the downloaded content
	MimeType string
	// Credentials allows to pass credentials and certificates for the http communication
	Credentials credentials.Credentials
}

func (*Options) ApplyTo

func (o *Options) ApplyTo(opts *Options)

func (*Options) GetCredentials

func (o *Options) GetCredentials(url string) (credentials.Credentials, error)

func (*Options) Logger

func (o *Options) Logger(keyValuePairs ...interface{}) logging.Logger

Jump to

Keyboard shortcuts

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