wget

package
v0.18.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 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

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

func DataAccess

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

func Provider

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