filesystem

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

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

Go to latest
Published: Feb 19, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InstrumentationName    = "filesystem"
	InstrumentationVersion = "1.0.0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File interface {
	io.ReadWriteCloser
}

type InstrumentationOptionFunc

type InstrumentationOptionFunc func(io *InstrumentationOptions)

InstrumentationOptionFunc allows for providing dynamic options instrumentation as project becomes more stable

type InstrumentationOptions

type InstrumentationOptions struct {
	TracerProvider sdktrace.TracerProvider
}

type ManagedFS

type ManagedFS interface {
	Create(ctx context.Context, name string) (File, error)
	Delete(ctx context.Context, name string) error
	Open(ctx context.Context, name string) (File, error)
}

ManagedFS is an interface that allows CRUD interactions with a abstracted filesystem.

func ApplyFSLock

func ApplyFSLock(fs ManagedFS) ManagedFS

func ApplyInstrumented

func ApplyInstrumented(fs ManagedFS, opts ...InstrumentationOptionFunc) ManagedFS

func NewMemory

func NewMemory(root string) (ManagedFS, error)

func NewOS

func NewOS(root string) (ManagedFS, error)

type NopFS

type NopFS struct{}

func (NopFS) Create

func (NopFS) Create(_ context.Context, _ string) (File, error)

func (NopFS) Delete

func (NopFS) Delete(_ context.Context, _ string) error

func (NopFS) Open

func (NopFS) Open(_ context.Context, _ string) (File, error)

type NopFile

type NopFile struct{}

func (NopFile) Close

func (NopFile) Close() error

func (NopFile) Read

func (NopFile) Read(in []byte) (int, error)

func (NopFile) Write

func (NopFile) Write(in []byte) (int, error)

Jump to

Keyboard shortcuts

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