atomicwriter

package
v0.0.0-...-abd3a35 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DriverInterface

type DriverInterface interface {
	NewAtomicWriter(context.Context, string) (Interface, error)
	Exists(context.Context, string) (bool, error)
}

DriverInterface is the interface an atomic writer driver fulfills. It can be used to create atomic writers.

func NewDriver

func NewDriver(ctx context.Context, dir string) (DriverInterface, error)

NewDriver returns a driver for the specified path.

func NewFileSystemDriver

func NewFileSystemDriver(dir string) DriverInterface

NewFileSystemDriver returns a new atomic writer backed by the local file system.

func NewGCSDriver

func NewGCSDriver(ctx context.Context, dir string, opts ...option.ClientOption) (DriverInterface, error)

NewGCSDriver returns a new atomic writer backed by Google Cloud Storage.

type Interface

type Interface interface {
	io.Writer

	// CloseAtomically will attempt to close the file, atomically committing it
	// to storage. The file will either be fully written, or an error is
	// returned.
	//
	// Clients can use os.IsExist(err) to check if the error was due to a name
	// conflict.
	CloseAtomically() error
}

Interface is the interface an individual atomic writer fulfills.

Jump to

Keyboard shortcuts

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