braintree

package
v0.0.0-...-a8e4d9d Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCacheMiss     = errors.New("braintree: cache miss")
	ErrCacheInternal = errors.New("braintree: cache internal error")
)

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Clear()

	// Entries returns all cache entries and ErrCacheMiss if the
	// cache is currently empty.
	Entries() ([]*braintreeAPI.Plan, error)

	// Set sets the entries in the cache.
	Set(entries []*braintreeAPI.Plan) error
}

type FileCache

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

func NewFileCache

func NewFileCache(filename string) *FileCache

func (*FileCache) Clear

func (self *FileCache) Clear()

func (*FileCache) Entries

func (self *FileCache) Entries() ([]*braintreeAPI.Plan, error)

func (*FileCache) Set

func (self *FileCache) Set(entries []*braintreeAPI.Plan) error

type MemoryCache

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

func NewMemoryCache

func NewMemoryCache() *MemoryCache

func (*MemoryCache) Clear

func (self *MemoryCache) Clear()

func (*MemoryCache) Entries

func (self *MemoryCache) Entries() ([]*braintreeAPI.Plan, error)

func (*MemoryCache) Set

func (self *MemoryCache) Set(entries []*braintreeAPI.Plan) error

type Proxy

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

func NewProxy

func NewProxy(cache Cache, apiClient stores.Braintree) *Proxy

func (*Proxy) ClearCache

func (self *Proxy) ClearCache()

func (*Proxy) FindAllPlans

func (self *Proxy) FindAllPlans() ([]*braintreeAPI.Plan, error)

func (*Proxy) ServeHTTP

func (self *Proxy) ServeHTTP(w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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