fetch

package
v1.13.7 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsOGS

func IsOGS(urlStr string) bool

Types

type Client

type Client interface {
	Get(string) (*http.Response, error)
}

type DefaultFetcher

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

func NewDefaultFetcher

func NewDefaultFetcher(client Client) *DefaultFetcher

func (*DefaultFetcher) ApprovedFetch

func (f *DefaultFetcher) ApprovedFetch(urlStr string) (string, error)

func (*DefaultFetcher) Fetch

func (f *DefaultFetcher) Fetch(urlStr string) (string, error)

func (*DefaultFetcher) FetchOGS

func (f *DefaultFetcher) FetchOGS(ogsURL string) (string, error)

func (*DefaultFetcher) OGSCheckEnded

func (f *DefaultFetcher) OGSCheckEnded(ogsURL string) (bool, error)

type EmptyFetcher

type EmptyFetcher struct{}

func NewEmptyFetcher

func NewEmptyFetcher() *EmptyFetcher

func (*EmptyFetcher) ApprovedFetch

func (f *EmptyFetcher) ApprovedFetch(s string) (string, error)

func (*EmptyFetcher) Fetch

func (f *EmptyFetcher) Fetch(s string) (string, error)

func (*EmptyFetcher) FetchOGS

func (f *EmptyFetcher) FetchOGS(s string) (string, error)

func (*EmptyFetcher) OGSCheckEnded

func (f *EmptyFetcher) OGSCheckEnded(s string) (bool, error)

type Fetcher

type Fetcher interface {
	OGSCheckEnded(string) (bool, error)
	FetchOGS(string) (string, error)
	Fetch(string) (string, error)
	ApprovedFetch(string) (string, error)
}

type MockClient

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

func NewMockClient

func NewMockClient(sgf string) *MockClient

func (*MockClient) Get

func (mc *MockClient) Get(s string) (*http.Response, error)

type MockFetcher

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

func NewMockFetcher

func NewMockFetcher(body string) *MockFetcher

func (*MockFetcher) ApprovedFetch

func (mf *MockFetcher) ApprovedFetch(s string) (string, error)

func (*MockFetcher) Fetch

func (mf *MockFetcher) Fetch(s string) (string, error)

func (*MockFetcher) FetchOGS

func (mf *MockFetcher) FetchOGS(s string) (string, error)

func (*MockFetcher) OGSCheckEnded

func (mf *MockFetcher) OGSCheckEnded(s string) (bool, error)

Jump to

Keyboard shortcuts

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