storage

package
v2.9.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeysWithFixedSlashed added in v2.3.5

func KeysWithFixedSlashed(keys []string) []string

KeysWithFixedSlashed remove prefixed or postfixed slashed in a path because it is not valid path and will fail fs.ValidPath validation

func NewAppStorage

func NewAppStorage(settings model.DatabaseSettings) (model.AppStorage, error)

NewAppStorage creates new app storage from settings

func NewConnectionTester

func NewConnectionTester(settings model.TestConnection) (model.ConnectionTester, error)

func NewDatabaseConnectionTester

func NewDatabaseConnectionTester(settings model.DatabaseSettings) model.ConnectionTester

func NewFS

func NewFS(settings model.FileStorageSettings) (fs.FS, error)

func NewFileStorageConnectionTester

func NewFileStorageConnectionTester(settings model.FileStorageSettings, expectedFiles []string) model.ConnectionTester

func NewInviteStorage

func NewInviteStorage(settings model.DatabaseSettings) (model.InviteStorage, error)

NewInviteStorage creates new invite storage from settings

func NewKeyStorage

func NewKeyStorage(settings model.FileStorageSettings) (model.KeyStorage, error)

func NewKeyStorageConnectionTester

func NewKeyStorageConnectionTester(settings model.FileStorageSettings) model.ConnectionTester

func NewManagementKeys added in v2.4.4

func NewManagementKeys(settings model.DatabaseSettings) (model.ManagementKeysStorage, error)

NewManagementKeys creates new management keys storage from settings.

func NewSessionStorage

func NewSessionStorage(settings model.SessionStorageSettings) (model.SessionStorage, error)

NewSessionStorage creates new sessions storage from settings

func NewTokenBlacklistStorage

func NewTokenBlacklistStorage(settings model.DatabaseSettings) (model.TokenBlacklist, error)

NewTokenBlacklistStorage creates new tokens blacklist storage from settings

func NewTokenStorage

func NewTokenStorage(settings model.DatabaseSettings) (model.TokenStorage, error)

NewTokenStorage creates new tokens storage from settings

func NewUserStorage

func NewUserStorage(settings model.DatabaseSettings) (model.UserStorage, error)

NewUserStorage creates new users storage from settings

func NewVerificationCodesStorage

func NewVerificationCodesStorage(settings model.DatabaseSettings) (model.VerificationCodeStorage, error)

NewVerificationCodesStorage creates new verification codes storage from settings

Types

type AlwaysFailedConnectionTester

type AlwaysFailedConnectionTester struct{}

func (AlwaysFailedConnectionTester) Connect

func (ct AlwaysFailedConnectionTester) Connect() error

type AlwaysHappyConnectionTester

type AlwaysHappyConnectionTester struct{}

func (AlwaysHappyConnectionTester) Connect

func (ct AlwaysHappyConnectionTester) Connect() error

type FSWatcher added in v2.3.0

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

FSWatcher watch for files changes in FS and notifies on file change

func NewFSWatcher added in v2.3.0

func NewFSWatcher(f fs.FS, keys []string, poll time.Duration) *FSWatcher

func (*FSWatcher) AppendForWatching added in v2.3.0

func (w *FSWatcher) AppendForWatching(path string)

func (*FSWatcher) ErrorChan added in v2.3.0

func (w *FSWatcher) ErrorChan() <-chan error

func (*FSWatcher) IsWatching added in v2.3.0

func (w *FSWatcher) IsWatching() bool

func (*FSWatcher) Stop added in v2.3.0

func (w *FSWatcher) Stop()

func (*FSWatcher) Watch added in v2.3.0

func (w *FSWatcher) Watch()

func (*FSWatcher) WatchChan added in v2.3.0

func (w *FSWatcher) WatchChan() <-chan []string

type RootReplacedFS

type RootReplacedFS struct {
	Root string
	FS   fs.FS
}

RootReplacedFS add root prefix on top of every url of underlying fs.FS

func (*RootReplacedFS) Open

func (f *RootReplacedFS) Open(name string) (fs.File, error)

we add root path every time we want to open the file

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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