cacheproxy

package
v0.0.0-...-b1bbf48 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheStorage

type CacheStorage = KVStorage[FileInformation, string]

type CacheableProxy

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

func New

func New(storage CacheStorage, targetURL string, port uint16) (*CacheableProxy, error)

func (*CacheableProxy) Director

func (proxy *CacheableProxy) Director(req *http.Request)

func (*CacheableProxy) Handler

func (proxy *CacheableProxy) Handler(w http.ResponseWriter, r *http.Request)

func (*CacheableProxy) InterceptFile

func (proxy *CacheableProxy) InterceptFile(resp *http.Response) error

func (*CacheableProxy) Listen

func (proxy *CacheableProxy) Listen(
	ctx context.Context, startFeedback chan string,
) error

func (*CacheableProxy) RedirectRoundTripper

func (proxy *CacheableProxy) RedirectRoundTripper() http.RoundTripper

func (*CacheableProxy) ServeHost

func (proxy *CacheableProxy) ServeHost() string

type FileEnvelope

type FileEnvelope struct {
	Headers map[string][]string
	Status  uint16
}

type FileInformation

type FileInformation struct {
	FileMIME
	Envelope      FileEnvelope
	Content       []byte
	Checksum      []byte
	CreatedAt     time.Time
	ModifiedAt    time.Time
	ExtraMetadata map[string]string
}

type FileMIME

type FileMIME struct {
	Name      string
	Extension string
	MimeType  string
}

type KVStorage

type KVStorage[T any, K comparable] interface {
	Set(key K, value T) error
	Get(key K) (T, error)
}

Jump to

Keyboard shortcuts

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