dbcache

package
v0.0.0-...-51c7e80 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DetectExt = func(name string, data []byte) string {
	return filepath.Ext(name)
}

Functions

func GetResponse

func GetResponse(o *GetResponseOptions) (resp *http.Response, err error)

func SetResponse

func SetResponse(o *SetResponseOptions) (err error)

Types

type Cache

type Cache struct {
	GetDB func(r *http.Request) (*gorm.DB, *gorm.DB, error)
}

func (*Cache) DeleteResponse

func (d *Cache) DeleteResponse(req *http.Request) error

func (*Cache) GetResponse

func (d *Cache) GetResponse(req *http.Request) (resp *http.Response, err error)

func (*Cache) SetResponse

func (d *Cache) SetResponse(resp *http.Response) (err error)

type GetResponseOptions

type GetResponseOptions struct {
	DB      *gorm.DB
	FileDB  *gorm.DB
	Request *http.Request
}

type SetResponseOptions

type SetResponseOptions struct {
	DB                  *gorm.DB
	FileDB              *gorm.DB
	Response            *http.Response
	Dry                 bool
	Responses           []*models.HTTPResponse
	FileContents        []*models.FileContent
	FileRefs            []*models.FileRef
	OnConflictDoNothing bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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