storage

package
v0.0.0-...-317d7e6 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireID

func AcquireID() (string, error)

AcquireID generates a new unique ID

func Load

func Load() error

Load loads the current storage driver

Types

type Driver

type Driver interface {
	Initialize() error
	Terminate() error
	ListIDs() ([]string, error)
	Get(id string) (*shared.Paste, error)
	Save(paste *shared.Paste) error
	Delete(id string) error
	Cleanup() (int, error)
}

Driver represents a storage driver

var Current Driver

Current holds the current storage driver

func GetDriver

func GetDriver(storageType shared.StorageType) (Driver, error)

GetDriver returns the driver with the given type if it exists

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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