Versions in this module Expand all Collapse all v0 v0.4.0 Mar 9, 2025 Changes in this version + var DefaultConfig = ...() + var ErrMissingCache = errors.New("cache not set when creating transport") + var ErrMissingConfig = errors.New("config not set when creating transport") + var ErrNoDatabase = errors.New("no database connection") + var ErrNoResponse = errors.New("no stored response") + func NewConfigBuilder() *configBuilder + type Cache interface + Read func(request *http.Request) (*http.Response, error) + ReadContext func(ctx context.Context, request *http.Request) (*http.Response, error) + Save func(response *http.Response, expiryTime *time.Duration) error + SaveContext func(ctx context.Context, response *http.Response, expiryTime *time.Duration) error + type Config struct + AllowedMethods []string + AllowedStatusCodes []int + ExpiryTime *time.Duration + type SqliteCache struct + Database *sql.DB + func NewSqliteCache(databaseName string) (*SqliteCache, error) + func (s *SqliteCache) Read(request *http.Request) (*http.Response, error) + func (s *SqliteCache) ReadContext(ctx context.Context, request *http.Request) (*http.Response, error) + func (s *SqliteCache) Save(response *http.Response, expiryTime *time.Duration) error + func (s *SqliteCache) SaveContext(ctx context.Context, response *http.Response, expiryTime *time.Duration) error + type Transport struct + func NewTransport(config *Config, cache Cache) (*Transport, error) + func (t *Transport) RoundTrip(request *http.Request) (*http.Response, error)