storage

package
v2.2.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2020 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DashboardNotFoundError

type DashboardNotFoundError struct {
	DashboardID string
}

DashboardNotFoundError signalizes the requested dashboard could not be found

func (DashboardNotFoundError) Error

func (e DashboardNotFoundError) Error() string

type FileStorage

type FileStorage struct {
	// contains filtered or unexported fields
}

FileStorage is a storage adapter storing the data into single local files

func NewFileStorage

func NewFileStorage(uri *url.URL) *FileStorage

NewFileStorage instanciates a new FileStorage

func (*FileStorage) Delete

func (f *FileStorage) Delete(dashboardID string) error

Delete deletes the given dashboard from FS

func (*FileStorage) Exists

func (f *FileStorage) Exists(dashboardID string) (bool, error)

Exists checks for the existence of the given dashboard

func (*FileStorage) Get

func (f *FileStorage) Get(dashboardID string) ([]byte, error)

Get loads the data for the given dashboard from FS

func (*FileStorage) Put

func (f *FileStorage) Put(dashboardID string, data []byte) error

Put writes the given data to FS

type S3Storage

type S3Storage struct {
	// contains filtered or unexported fields
}

S3Storage is a storage adapter storing the data into single S3 files

func NewS3Storage

func NewS3Storage(uri *url.URL) *S3Storage

NewS3Storage instanciates a new S3Storage

func (*S3Storage) Delete

func (s *S3Storage) Delete(dashboardID string) error

Delete deletes the given dashboard from S3

func (*S3Storage) Exists

func (s *S3Storage) Exists(dashboardID string) (bool, error)

Exists checks for the existence of the given dashboard

func (*S3Storage) Get

func (s *S3Storage) Get(dashboardID string) ([]byte, error)

Get loads the data for the given dashboard from S3

func (*S3Storage) Put

func (s *S3Storage) Put(dashboardID string, data []byte) error

Put writes the given data to S3

type Storage

type Storage interface {
	Put(dashboardID string, data []byte) error
	Get(dashboardID string) ([]byte, error)
	Delete(dashboardID string) error
	Exists(dashboardID string) (bool, error)
}

Storage is an interface to have all storage systems compatible to each other

func GetStorage

func GetStorage(uri string) (Storage, error)

GetStorage acts as a storage factory providing the storage named by input name parameter

Jump to

Keyboard shortcuts

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