filestore

package
v0.0.0-...-9a0c461 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStore

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

FileStore is a simple implementation of the FileStore interface, that stores and reads data from the local filesystem.

func NewFileStore

func NewFileStore(rootDir string) *FileStore

func (*FileStore) AppendToFile

func (s *FileStore) AppendToFile(_ context.Context, path, content string) error

func (*FileStore) ReadFile

func (s *FileStore) ReadFile(_ context.Context, path string) (string, error)

func (*FileStore) WriteFile

func (s *FileStore) WriteFile(_ context.Context, path, content string) error

type InMemory

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

InMemory is a simple implementation of the FileStore interface, that stores and reads data from memory.

func NewInMemory

func NewInMemory() *InMemory

func (*InMemory) AppendToFile

func (s *InMemory) AppendToFile(ctx context.Context, path, content string) error

func (*InMemory) ReadFile

func (s *InMemory) ReadFile(_ context.Context, path string) (string, error)

func (*InMemory) WriteFile

func (s *InMemory) WriteFile(_ context.Context, path, content string) error

Jump to

Keyboard shortcuts

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