Documentation ¶
Index ¶
- type HTTPLoader
- type Option
- func WithAccept(contentType string) Option
- func WithAllowedSources(hosts ...string) Option
- func WithDefaultScheme(scheme string) Option
- func WithForwardClientHeaders(enabled bool) Option
- func WithForwardHeaders(headers ...string) Option
- func WithInsecureSkipVerifyTransport(enabled bool) Option
- func WithMaxAllowedSize(maxAllowedSize int) Option
- func WithOverrideHeader(name, value string) Option
- func WithProxyTransport(proxyURLs, hosts string) Option
- func WithTransport(transport http.RoundTripper) Option
- func WithUserAgent(userAgent string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPLoader ¶
type HTTPLoader struct { // The Transport used to request images, default http.DefaultTransport. Transport http.RoundTripper // ForwardHeaders copy request headers to image request headers ForwardHeaders []string // OverrideHeaders override image request headers OverrideHeaders map[string]string // AllowedSources list of host names allowed to load from, // supports glob patterns such as *.google.com AllowedSources []string // Accept set request Accept and validate response Content-Type header Accept string // MaxAllowedSize maximum bytes allowed for image MaxAllowedSize int // DefaultScheme default image URL scheme DefaultScheme string // UserAgent default user agent for image request. // Can be overridden by ForwardHeaders and OverrideHeaders UserAgent string // contains filtered or unexported fields }
func New ¶
func New(options ...Option) *HTTPLoader
type Option ¶
type Option func(h *HTTPLoader)
func WithAccept ¶ added in v0.7.5
func WithAllowedSources ¶
func WithDefaultScheme ¶
func WithForwardClientHeaders ¶ added in v0.8.15
func WithForwardHeaders ¶
func WithMaxAllowedSize ¶
func WithOverrideHeader ¶
func WithProxyTransport ¶ added in v0.7.3
func WithTransport ¶
func WithTransport(transport http.RoundTripper) Option
func WithUserAgent ¶
Click to show internal directories.
Click to hide internal directories.