Beispiel #1
0
// Folder returns an instance of Storage backed by the local
// file system. Each key is a file at the provided path.
func Folder(path string) Storage {
	if path == "" {
		return local.New()
	}

	return folder.New(path)
}
Beispiel #2
0
// Redis returns an instance of Storage backed by a Redis service.
func Redis(host, port string) Storage {
	if host == "" || port == "" {
		return local.New()
	}

	return redis.New(host, port)
}
Beispiel #3
0
// Local returns an instance of Storage backed only by the
// memory of the running binary.
func Local() Storage {
	return local.New()
}