transport

package
v1.0.11 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: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NeedUseDragonfly

func NeedUseDragonfly(req *http.Request) bool

NeedUseDragonfly is the default value for shouldUseDragonfly, which downloads all images layers with dragonfly.

func New

func New(options ...Option) (http.RoundTripper, error)

New constructs a new instance of a RoundTripper with additional options.

Types

type Option

type Option func(rt *transport) *transport

Option is functional config for transport.

func WithCondition

func WithCondition(c func(r *http.Request) bool) Option

WithCondition configures how to decide whether to use dragonfly or not.

func WithDefaultApplication

func WithDefaultApplication(b string) Option

WithDefaultApplication sets default Application for http requests with X-Dragonfly-Application Header

func WithDefaultFilter

func WithDefaultFilter(f string) Option

WithDefaultFilter sets default filter for http requests with X-Dragonfly-Filter Header

func WithDefaultPriority

func WithDefaultPriority(p commonv1.Priority) Option

WithDefaultPriority sets default Priority for http requests with X-Dragonfly-Priority Header

func WithDefaultTag

func WithDefaultTag(b string) Option

WithDefaultTag sets default tag for http requests with X-Dragonfly-Tag Header

func WithDumpHTTPContent

func WithDumpHTTPContent(b bool) Option

func WithPeerIDGenerator

func WithPeerIDGenerator(peerIDGenerator peer.IDGenerator) Option

WithPeerIDGenerator sets the peerIDGenerator for transport

func WithPeerTaskManager

func WithPeerTaskManager(peerTaskManager peer.TaskManager) Option

WithPeerTaskManager sets the peerTaskManager for transport

func WithTLS

func WithTLS(cfg *tls.Config) Option

WithTLS configures TLS config used for http transport.

Jump to

Keyboard shortcuts

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