cache

package
v0.0.0-...-448ecbd Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidToken    = errors.New("TOKEN is required")
	ErrInvalidEndpoint = errors.New("ENDPOINT must be a valid URL")
)

Errors

Functions

func EvaluateKey

func EvaluateKey(key string) (string, error)

EvaluateKey parses the key and evaluates with template functions

func Restore

func Restore(client *Client, key, path string) error

Restore a path to the cache

func Store

func Store(client *Client, key, path string) error

Store a path to the cache

func VerifyPath

func VerifyPath(path string) error

VerifyPath checks that the path exists

Types

type Client

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

Client for cache money server API

func NewClient

func NewClient(token, endpoint string) (*Client, error)

NewClient for cache money server API

func (*Client) Check

func (c *Client) Check(key string) (bool, error)

Check if key exists in the cache server

func (*Client) Fetch

func (c *Client) Fetch(key string, w io.Writer) error

Fetch data from the cache server

func (*Client) Push

func (c *Client) Push(key, mimeType string, r io.Reader) error

Push data to the cache server

Jump to

Keyboard shortcuts

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