...

Package fetcher

import "github.com/ory/x/fetcher"
Overview
Index

Overview ▾

func WithClient

func WithClient(hc *http.Client) func(*opts)

WithClient sets the http.Client the fetcher uses.

type Fetcher

Fetcher is able to load file contents from http, https, file, and base64 locations.

type Fetcher struct {
    // contains filtered or unexported fields
}

func NewFetcher

func NewFetcher(opts ...func(*opts)) *Fetcher

NewFetcher creates a new fetcher instance.

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(source string) (*bytes.Buffer, error)

Fetch fetches the file contents from the source.