operation

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// VaultNotFoundErrMsg is the message returned by the EDV server when a vault can't be found.
	VaultNotFoundErrMsg = "specified vault does not exist"
	// DocumentNotFoundErrMsg is the message returned by the EDV server when a document can't be found
	// within the given vault.
	DocumentNotFoundErrMsg = "specified document does not exist"
	// DuplicateVaultErrMsg is the message returned by the EDV server when an attempt is made to create a vault with
	// the same ID as an already existing vault.
	DuplicateVaultErrMsg = "vault already exists"
	// DuplicateDocumentErrMsg is the message returned by the EDV server when an attempt is made to create a document with
	// the same ID as an already existing document inside the vault.
	DuplicateDocumentErrMsg = "a document with the given ID already exists"
	// NotBase58EncodedErrMsg is the message returned by the EDV server when an attempt is made
	// to create a document with an ID that is not a base58-encoded value (which is required by the EDV spec).
	NotBase58EncodedErrMsg = "document ID must be a base58-encoded value"
	// Not128BitValueErrMsg is the message returned by the EDV server when an attempt is made
	// to create a document with an ID that is base58-encoded, but the original value was not 128 bits long
	// (which is required by the EDV spec).
	Not128BitValueErrMsg = "document ID is base58-encoded, but original value before encoding was not 128 bits long"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DataVaultConfiguration added in v0.1.1

type DataVaultConfiguration struct {
	Sequence    int        `json:"sequence"`
	Controller  string     `json:"controller"`
	Invoker     string     `json:"invoker"`
	Delegator   string     `json:"delegator"`
	ReferenceID string     `json:"referenceId"`
	KEK         IDTypePair `json:"kek"`
	HMAC        IDTypePair `json:"hmac"`
}

DataVaultConfiguration represents a Data Vault Configuration. For use with an EDV.

type Handler

type Handler interface {
	Path() string
	Method() string
	Handle() http.HandlerFunc
}

Handler http handler for each controller API endpoint

type IDTypePair added in v0.1.1

type IDTypePair struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

IDTypePair represents an ID+type pair. Used in the DataVaultConfiguration struct.

type Operation

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

Operation defines handlers for EDV service

func New

func New(provider storage.Provider, dbPrefix string) *Operation

New returns a new EDV operations instance. If dbPrefix is blank, then no prefixing will be done to the vault IDs.

func (*Operation) GetRESTHandlers

func (c *Operation) GetRESTHandlers() []Handler

GetRESTHandlers get all controller API handler available for this service

type StructuredDocument added in v0.1.1

type StructuredDocument struct {
	ID      string                 `json:"id"`
	Meta    map[string]interface{} `json:"meta"`
	Content map[string]interface{} `json:"content"`
}

StructuredDocument represents a Structured Document. For use with an EDV.

type VaultCollection

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

VaultCollection represents EDV storage.

Jump to

Keyboard shortcuts

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