Version: v1.0.0 Latest Latest

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



Package savers provides implementations for the uuid.Saver interface.

This package provides savers for the package 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 2014 MIT licence



This section is empty.


This section is empty.


This section is empty.


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

	// The next time to save

	// 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
t or T : Toggle theme light dark auto
y or Y : Canonical URL