prefetch

package
v0.0.0-...-cea0af2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPrefetchNotDocument          = fmt.Errorf("prefetch: not document")
	ErrThrottled                    = fmt.Errorf("prefetch: throttled")
	ErrNoPushChannel                = fmt.Errorf("prefetch: no push channel")
	ErrResourceExistsInRFC7234Cache = fmt.Errorf("prefetch: resource exists in rfc7234 cache")
)

Functions

This section is empty.

Types

type PrefetchClient

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

func NewPrefetchClient

func NewPrefetchClient(
	dialPrefetchStream func(string) (net.Conn, error),
) *PrefetchClient

func (*PrefetchClient) Do

func (pc *PrefetchClient) Do(req *http.Request) (*http.Response, error)

func (*PrefetchClient) FilterRequest

func (pc *PrefetchClient) FilterRequest(req *http.Request) (result bool)

type PrefetchServer

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

func NewPrefetchServer

func NewPrefetchServer(baseHttpClient http.RoundTripper) *PrefetchServer

func (*PrefetchServer) CreatePushChannel

func (ps *PrefetchServer) CreatePushChannel(conn net.Conn)

func (*PrefetchServer) TryPrefetch

func (ps *PrefetchServer) TryPrefetch(ctx context.Context, resp *http.Response) (err error)

type PushChannelClient

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

func NewPushChannelClient

func NewPushChannelClient(dialFn func(string) (net.Conn, error), pushRespCh chan *http.Response) *PushChannelClient

func (*PushChannelClient) Close

func (pc *PushChannelClient) Close() error

type PushChannelServer

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

func NewPushChannelServer

func NewPushChannelServer(conn net.Conn) *PushChannelServer

func (*PushChannelServer) Close

func (ps *PushChannelServer) Close() error

func (*PushChannelServer) Push

func (ps *PushChannelServer) Push(ctx context.Context, resp *http.Response) error

type PushResponseHeader

type PushResponseHeader struct {
	UrlString string
	// TODO: compression?
	ResponseWithoutBody []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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