dsfile

package module
v0.0.0-...-4c495c0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2015 License: MIT Imports: 15 Imported by: 0

README

dsfile

file-based data structure persistence

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cbor

type Cbor struct{}

func (*Cbor) Decode

func (c *Cbor) Decode(r io.Reader, obj interface{}) error

func (*Cbor) Encode

func (c *Cbor) Encode(w io.Writer, obj interface{}) error

type Codec

type Codec interface {
	Decode(io.Reader, interface{}) error
	Encode(io.Writer, interface{}) error
}

type Err

type Err struct {
	Pkg  string
	Info string
	Err  error
}

func (*Err) Error

func (e *Err) Error() string

type File

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

func New

func New(obj interface{}, path string, codec Codec, locker sync.Locker) (*File, error)

func (*File) Close

func (f *File) Close()

func (*File) Save

func (f *File) Save() error

type FileLocker

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

func NewFileLocker

func NewFileLocker(path string) *FileLocker

func (*FileLocker) Lock

func (l *FileLocker) Lock()

func (*FileLocker) Unlock

func (l *FileLocker) Unlock()

type Gob

type Gob struct{}

func (*Gob) Decode

func (g *Gob) Decode(r io.Reader, obj interface{}) error

func (*Gob) Encode

func (g *Gob) Encode(w io.Writer, obj interface{}) error

type Json

type Json struct{}

func (*Json) Decode

func (j *Json) Decode(r io.Reader, obj interface{}) error

func (*Json) Encode

func (j *Json) Encode(w io.Writer, obj interface{}) error

type PortLocker

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

func NewPortLocker

func NewPortLocker(port int) *PortLocker

func (*PortLocker) Lock

func (l *PortLocker) Lock()

func (*PortLocker) Unlock

func (l *PortLocker) Unlock()

Jump to

Keyboard shortcuts

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