Documentation ¶
Index ¶
- type HTTPLoader
- type Option
- func WithAllowedSources(hosts ...string) Option
- func WithDefaultScheme(scheme string) Option
- func WithForwardAllHeaders(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 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. // If nil, http.DefaultTransport is used. 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 // 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 }
func New ¶
func New(options ...Option) *HTTPLoader
type Option ¶
type Option func(h *HTTPLoader)
func WithAllowedSources ¶
func WithDefaultScheme ¶
func WithForwardAllHeaders ¶
func WithForwardHeaders ¶
func WithMaxAllowedSize ¶
func WithOverrideHeader ¶
func WithTransport ¶
func WithTransport(transport http.RoundTripper) Option
func WithUserAgent ¶
Click to show internal directories.
Click to hide internal directories.