azurestoragecache

package
v0.0.0-...-875a7fa Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package azurestorage provides an implementation of httpcache.Cache that stores and retrieves data using Azure Storage.

Index

Constants

This section is empty.

Variables

View Source
var (
	PluginConfig = &azurestorageConfig{
		done: make(chan struct{}),
	}
)

Config ...

Functions

This section is empty.

Types

type Cache

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

Cache stores and retrieves data using Azure Storage.

func New

func New(accountName string, accountKey string, containerName string) (*Cache, error)

New returns a new Cache with underlying client for Azure Storage.

accountName and accountKey are the Azure Storage credentials. If either are empty, the contents of the environment variables AZURESTORAGE_ACCOUNT_NAME and AZURESTORAGE_ACCESS_KEY will be used.

containerName is the container name in which cached values will be stored. If not specified, "cache" will be used.

func (*Cache) Debug

func (c *Cache) Debug(action string)

func (*Cache) Delete

func (c *Cache) Delete(key string)

Delete the cached value with the specified key.

func (*Cache) Get

func (c *Cache) Get(key string) (resp []byte, ok bool)

Get the cached value with the specified key.

func (*Cache) Set

func (c *Cache) Set(key string, value []byte)

Set the cached value with the specified key.

Jump to

Keyboard shortcuts

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