dydbassoc

package
v0.0.0-...-0f4c570 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package dydbassoc implements an assoc.Assoc based on AWS's DynamoDB.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assoc

type Assoc struct {
	DB        *dynamodb.DynamoDB
	Limiter   *limiter.Limiter
	TableName string
}

Assoc implements a DynamoDB-backed Assoc for use in caches. Each association entry is represented by a DynamoDB item with the attributes "ID" and "Value".

TODO(marius): support batch querying in this interface; it will be more efficient than relying on call concurrency.

func (*Assoc) Get

Lookup returns the digest associated with key digest k. Lookup returns an error flagged errors.NotExist when no such mapping exists. Lookup also modifies the item's last-accessed time, which can be used for LRU object garbage collection.

Get expands abbreviated keys by making use of a DynamoDB index.

func (*Assoc) Put

func (a *Assoc) Put(ctx context.Context, kind assoc.Kind, expect, k, v digest.Digest) error

Put associates the digest v with the key digest k in the dynamodb table. DynamoDB condtional expressions are used to implement compare-and-swap when expect is nonzero.

Jump to

Keyboard shortcuts

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