store

package
v0.0.0-...-ce1098a Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEntryTooLarge = errors.New("entry exceeds max size")

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Name       string          `msgpack:"-"`
	Originated msgputil.Time32 `msgpack:"_,extension"`
	Received   msgputil.Time32 `msgpack:"_,extension"`
	StatusCode int16
	Vary       bool
	// contains filtered or unexported fields
}

func (*Entry) DecodeMsg

func (z *Entry) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Entry) EncodeMsg

func (z *Entry) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Entry) MarshalMsg

func (z *Entry) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Entry) Msgsize

func (z *Entry) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Entry) UnmarshalMsg

func (z *Entry) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Key

type Key struct {
	Host     string `msgpack:"-"`
	URLHash  [md5.Size]byte
	Method   string
	BodyHash []byte
}

func (*Key) DecodeMsg

func (z *Key) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Key) EncodeMsg

func (z *Key) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Key) MarshalMsg

func (z *Key) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Key) Msgsize

func (z *Key) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Key) UnmarshalMsg

func (z *Key) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Store

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

func New

func New(path string) (*Store, error)

func (*Store) Del

func (s *Store) Del(entry Entry) error

func (*Store) Get

func (s *Store) Get(req *model.Request, entry Entry, withOrigRequest bool) (*http.Response, error)

func (*Store) List

func (s *Store) List(req *model.Request) ([]Entry, error)

func (*Store) Put

func (s *Store) Put(req *model.Request, res *http.Response) (err error)

Jump to

Keyboard shortcuts

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