timestamp

package
v0.0.0-...-f7d0ea7 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTimestamp

func CreateTimestamp(gun string, prev *data.SignedTimestamp, snapshot []byte, store storage.MetaStore, cryptoService signed.CryptoService) (*data.Signed, int, error)

CreateTimestamp creates a new timestamp. If a prev timestamp is provided, it is assumed this is the immediately previous one, and the new one will have a version number one higher than prev. The store is used to lookup the current snapshot, this function does not save the newly generated timestamp.

func GetOrCreateTimestamp

func GetOrCreateTimestamp(gun string, store storage.MetaStore, cryptoService signed.CryptoService) ([]byte, error)

GetOrCreateTimestamp returns the current timestamp for the gun. This may mean a new timestamp is generated either because none exists, or because the current one has expired. Once generated, the timestamp is saved in the store.

func GetOrCreateTimestampKey

func GetOrCreateTimestampKey(gun string, store storage.MetaStore, crypto signed.CryptoService, fallBackAlgorithm data.KeyAlgorithm) (data.PublicKey, error)

GetOrCreateTimestampKey returns the timestamp key for the gun. It uses the store to lookup an existing timestamp key and the crypto to generate a new one if none is found. It attempts to handle the race condition that may occur if 2 servers try to create the key at the same time by simply querying the store a second time if it receives a conflict when writing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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