file

package
v0.0.0-...-70e5bc8 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Package file implements the File interface used in client.Open and client.Create.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

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

File is a simple implementation of upspin.File. It always keeps the whole file in memory under the assumption that it is encrypted and must be read and written atomically.

func Readable

func Readable(cfg upspin.Config, entry *upspin.DirEntry) (*File, error)

Readable creates a new File for the given DirEntry that must be readable using the given Config.

func Writable

func Writable(client upspin.Client, name upspin.PathName) *File

Writable creates a new file with a given name, belonging to a given client for write. Once closed, the file will overwrite any existing file with the same name.

func (*File) Close

func (f *File) Close() error

Close implements upspin.File.

func (*File) Name

func (f *File) Name() upspin.PathName

Name implements upspin.File.

func (*File) Read

func (f *File) Read(b []byte) (n int, err error)

Read implements upspin.File.

func (*File) ReadAt

func (f *File) ReadAt(b []byte, off int64) (n int, err error)

ReadAt implements upspin.File.

func (*File) Seek

func (f *File) Seek(offset int64, whence int) (ret int64, err error)

Seek implements upspin.File.

func (*File) Write

func (f *File) Write(b []byte) (n int, err error)

Write implements upspin.File.

func (*File) WriteAt

func (f *File) WriteAt(b []byte, off int64) (n int, err error)

WriteAt implements upspin.File.

Jump to

Keyboard shortcuts

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