filemarshal

package
v0.0.0-...-e91a9a7 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder interface {
	Decode(x interface{}) error
}

Decoder represents a decoding method. Examples include gob.Decoder and json.Decoder.

func NewDecoder

func NewDecoder(dec Decoder) Decoder

NewDecoder returns a new Decoder that can decode an encoding stream produced by an encoder created with NewEncoder. Any File data gets written to disk rather than being stored in memory. When a File is decoded, its file name will have changed to the name of a local temporary file holding the same data.

type Encoder

type Encoder interface {
	// Encode writes an encoded version of x.
	Encode(x interface{}) error
}

Encoder represents a encoding method. Examples include gob.Encoder and json.Encoder.

func NewEncoder

func NewEncoder(enc Encoder) Encoder

NewEncoder returns a new Encoder that will encode any *File instance that it finds within values passed to Encode. The resulting encoded stream must be decoded with a decoder created by NewDecoder.

type File

type File struct {
	Name string // The name of the file.
	// contains filtered or unexported fields
}

A File holds on-disk storage.

func NewFile

func NewFile(f *os.File) *File

NewFile creates a new file referring to f, which should be seekable (i.e. not a pipe or network connection).

func (*File) File

func (f *File) File() *os.File

File returns the backing file of f.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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