nats

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalid              = os.ErrInvalid
	ErrNotExist             = os.ErrNotExist
	ErrIsDirectory          = memfs.ErrIsDirectory
	ErrSymlinksNotSupported = errors.New("symlinks not supported")
	ErrBadDescriptor        = errors.New("bad descriptor")
	ErrNotSynced            = errors.New("filesystem not synchronized")
)

Functions

This section is empty.

Types

type Error added in v0.3.1

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

func (*Error) Error added in v0.3.1

func (e *Error) Error() string

type FS

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

func NewFS

func NewFS(ctx context.Context, store jetstream.ObjectStore) (*FS, error)

func (*FS) Close

func (fs *FS) Close() error

Close shuts down the filesystem

func (*FS) Create

func (fs *FS) Create(name string) (risoros.File, error)

Create creates a new file (NATS + cache structure)

func (*FS) Mkdir

func (fs *FS) Mkdir(name string, perm risoros.FileMode) error

Mkdir returns an error as explicit directory creation is not supported

func (*FS) MkdirAll

func (fs *FS) MkdirAll(pth string, perm risoros.FileMode) error

MkdirAll returns an error as explicit directory creation is not supported

func (*FS) Open

func (fs *FS) Open(name string) (risoros.File, error)

Open opens a file for reading (fetches content from NATS)

func (*FS) OpenFile

func (fs *FS) OpenFile(name string, flag int, perm risoros.FileMode) (risoros.File, error)

OpenFile opens a file with specified flags (cache structure + NATS for content)

func (*FS) ReadDir

func (fs *FS) ReadDir(name string) ([]risoros.DirEntry, error)

ReadDir reads directory contents from the cache

func (*FS) ReadFile

func (fs *FS) ReadFile(name string) ([]byte, error)

ReadFile reads the entire contents of a file from NATS

func (*FS) Remove

func (fs *FS) Remove(name string) error

Remove removes a file

func (*FS) RemoveAll

func (fs *FS) RemoveAll(pth string) error

RemoveAll removes a path and its implied children

func (*FS) Rename

func (fs *FS) Rename(oldpath, newpath string) error

Rename renames a file

func (*FS) Stat

func (fs *FS) Stat(name string) (risoros.FileInfo, error)

Stat returns file information (cache only)

func (fs *FS) Symlink(oldname, newname string) error

Symlink creates a symbolic link

func (*FS) Wait

func (fs *FS) Wait(ctx context.Context) error

func (*FS) WalkDir

func (fs *FS) WalkDir(root string, fn risoros.WalkDirFunc) error

WalkDir walks the directory tree in the cache

func (*FS) WriteFile

func (fs *FS) WriteFile(name string, data []byte, perm risoros.FileMode) error

WriteFile writes data to a file

Jump to

Keyboard shortcuts

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