storage

package module
v0.0.0-...-601d287 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DropboxStorage

type DropboxStorage struct {
	Path string
}

DropboxStorage provides file-system based storage

func NewDropboxStorage

func NewDropboxStorage(path string) *DropboxStorage

func (*DropboxStorage) Read

func (f *DropboxStorage) Read(rid string) ([]byte, error)

Read implements Storage.Read method

func (*DropboxStorage) Records

func (f *DropboxStorage) Records() ([]string, error)

Records implement Storage Records method

func (*DropboxStorage) Write

func (f *DropboxStorage) Write(fname string, rec []byte) error

Write implements Storage.Write method

type FileStorage

type FileStorage struct {
	Path string
}

FileStorage provides file-system based storage

func NewFileStorage

func NewFileStorage(path string) *FileStorage

func (*FileStorage) Read

func (f *FileStorage) Read(rid string) ([]byte, error)

Read implements Storage.Read method

func (*FileStorage) Records

func (f *FileStorage) Records() ([]string, error)

Records implement Storage Records method

func (*FileStorage) Write

func (f *FileStorage) Write(fname string, rec []byte) error

Write implements Storage.Write method

type GoogleDriveStorage

type GoogleDriveStorage struct {
	Path string
}

GoogleDriveStorage provides file-system based storage

func NewGoogleDriveStorage

func NewGoogleDriveStorage(path string) *GoogleDriveStorage

func (*GoogleDriveStorage) Read

func (f *GoogleDriveStorage) Read(rid string) ([]byte, error)

Read implements Storage.Read method

func (*GoogleDriveStorage) Records

func (f *GoogleDriveStorage) Records() ([]string, error)

Records implement Storage Records method

func (*GoogleDriveStorage) Write

func (f *GoogleDriveStorage) Write(fname string, rec []byte) error

Write implements Storage.Write method

type SSHStorage

type SSHStorage struct {
	Path string
}

SSHStorage provides file-system based storage

func NewSSHStorage

func NewSSHStorage(path string) *SSHStorage

func (*SSHStorage) Read

func (f *SSHStorage) Read(rid string) ([]byte, error)

Read implements Storage.Read method

func (*SSHStorage) Records

func (f *SSHStorage) Records() ([]string, error)

Records implement Storage Records method

func (*SSHStorage) Write

func (f *SSHStorage) Write(fname string, rec []byte) error

Write implements Storage.Write method

type Storage

type Storage interface {
	// Read reades from storage
	Read(rid string) ([]byte, error)
	// Write writes given record to storage using givne file name
	Write(fname string, rec []byte) error
	// Records return list of record ids from storage
	Records() ([]string, error)
}

Storage defines generic storage interface

Jump to

Keyboard shortcuts

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