savers

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package savers provides implementations for the uuid.Saver interface.

This package provides savers for the package github.com/myesui/uuid RFC4122 and DCE 1.1 UUIDs.

Use this package for V1 and V2 UUIDs or your own UUID implementation.

By applying a savers you can store any UUID generation data in a non volatile store, the purpose of which is to save the clock sequence, last timestamp and the last node id used from the last generated UUID.

The Saver Save method is called every time you generate a V1 or V2 UUID.

You do not have to register a savers. The code will generate a random clock sequence or node id if required. The example code in the specification was used as reference for design.

Copyright (C) 2016 myesui@github.com 2014 MIT licence

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileSystemSaver

type FileSystemSaver struct {

	// Preferred location for the store
	Path string

	// Whether to log each save
	Report bool

	// The amount of time between each save call
	time.Duration

	// The next time to save
	uuid.Timestamp

	*log.Logger
	// contains filtered or unexported fields
}

FileSystemSaver implements the uuid.Saver interface.

func (*FileSystemSaver) Init added in v1.0.0

func (o *FileSystemSaver) Init() uuid.Saver

func (*FileSystemSaver) Read

func (o *FileSystemSaver) Read() (store uuid.Store, err error)

Read reads and loads the Store from the filesystem.

func (*FileSystemSaver) Save

func (o *FileSystemSaver) Save(store uuid.Store)

Save saves the given store to the filesystem.

Jump to

Keyboard shortcuts

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