assoc

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: 2 Imported by: 0

Documentation

Overview

Package assoc defines data types for associative maps used within Reflow.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(ctx context.Context, assoc Assoc, kind Kind, k digest.Digest) error

Delete deletes the key k unconditionally from the provided assoc.

Types

type Assoc

type Assoc interface {
	// Put associates the digest v with the key digest k of the provided
	// kind. If expect is nonzero, Put performs a compare-and-set,
	// erroring with errors.Precondition if the expected current value
	// was not equal to expect. Zero values indicate that the association
	// is to be deleted.
	Put(ctx context.Context, kind Kind, expect, k, v digest.Digest) error

	// Get returns the digest associated with key digest k and the
	// provided kind. Get returns an errors.NotExist when no such
	// mapping exists. Get expands the provided key when it is abbreviated,
	// and returns the expanded key when appropriate.
	Get(ctx context.Context, kind Kind, k digest.Digest) (kexp, v digest.Digest, err error)
}

An Assoc is an associative array mapping digests to other digests. Mappings are also assigned a kind, and can thus be expanded to store multiple types of mapping for each key.

type Kind

type Kind int

Kind describes the kind of mapping.

const (
	// Fileset maps fileset values.
	Fileset Kind = iota
)

Directories

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

Jump to

Keyboard shortcuts

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