filesystem

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const PDFFileExtension = "pdf"

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchiveService

type ArchiveService struct {
	*DiskStorage
}

func NewArchiveService

func NewArchiveService(directory string) (*ArchiveService, error)

func (*ArchiveService) Get

func (*ArchiveService) Set

func (f *ArchiveService) Set(resource storage.KeyedResource) error

type DiskStorage

type DiskStorage struct {
	Root string
	// contains filtered or unexported fields
}

func NewDiskStorage

func NewDiskStorage(directory string) (*DiskStorage, error)

NewDiskStorage creates and initializes Storage on the local filesystem using the provided directory as the root.

func (*DiskStorage) Check

func (s *DiskStorage) Check(ctx context.Context) (string, error)

Check returns the health status of the file system.

func (*DiskStorage) CopyFolder

func (s *DiskStorage) CopyFolder(ctx context.Context, source storage.Locatable, dest storage.Locatable) error

func (*DiskStorage) Delete

func (s *DiskStorage) Delete(resource storage.Locatable) error

Delete deletes the specified Locatable from the file system.

func (*DiskStorage) ForEach

func (s *DiskStorage) ForEach(ctx context.Context, keyed storage.Keyed, forEachFn ForEachFunc) error

ForEach executes the provided function for each stored element.

func (*DiskStorage) Get

func (s *DiskStorage) Get(ctx context.Context, resource storage.Locatable) (resourceWithData *storage.GenericResource, err error)

Get retrieves a copy of the specified resource from the file system.

func (*DiskStorage) Locate

func (s *DiskStorage) Locate(resource storage.Locatable) string

Locate returns the location of the specified Locatable.

func (*DiskStorage) ModTime

func (s *DiskStorage) ModTime(resource storage.KeyedResource) (time.Time, error)

ModTime returns the time at which the element was last changed.

func (*DiskStorage) NumberOfElements

func (s *DiskStorage) NumberOfElements(ctx context.Context) (int, error)

func (*DiskStorage) Write

func (s *DiskStorage) Write(resource storage.KeyedResource) (err error)

Write writes the specified resource to the file system. It creates the files if it does not exist yet.

type ForEachFunc

type ForEachFunc func(resource storage.KeyedResource, err error) error

type ImageService

type ImageService struct {
	*DiskStorage
	// contains filtered or unexported fields
}

func NewImageService

func NewImageService(directory string) (*ImageService, error)

func (*ImageService) Copy

func (f *ImageService) Copy(ctx context.Context, fromId string, toId string) error

func (*ImageService) GetByRecordId

func (f *ImageService) GetByRecordId(ctx context.Context, id string) (map[string]*storage.Image, error)

type RecordDirectory

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

func (RecordDirectory) Key

func (dir RecordDirectory) Key() []string

Jump to

Keyboard shortcuts

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