azurestoragecache

package module
v0.0.0-...-3c249a3 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2017 License: Apache-2.0 Imports: 9 Imported by: 13

README

azurestoragecache

Azure Storage interface for a Go cache

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

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) 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.

Directories

Path Synopsis
Testing azurestoragecache (set, get, delete) Parameters - accountName : Azure Storage Account Name - accountKey : Azure Storage Account Key - containerName : Azure Storage Container Name /!\ must be lower-case
Testing azurestoragecache (set, get, delete) Parameters - accountName : Azure Storage Account Name - accountKey : Azure Storage Account Key - containerName : Azure Storage Container Name /!\ must be lower-case

Jump to

Keyboard shortcuts

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