repo

package
v0.0.0-...-c592df2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DuplicateError

type DuplicateError struct {
	Type        ObjectType
	ExistingId  uint64
	DesiredName string
}

func (*DuplicateError) Error

func (err *DuplicateError) Error() string

type NotFoundError

type NotFoundError struct {
	Type ObjectType
	Id   uint64
	Name string
}

func (*NotFoundError) Error

func (err *NotFoundError) Error() string

type ObjectType

type ObjectType string
const (
	BLOB  ObjectType = "blob"
	USER  ObjectType = "user"
	GROUP ObjectType = "group"
)

func (ObjectType) GoString

func (ot ObjectType) GoString() string

func (ObjectType) String

func (ot ObjectType) String() string

type Repo

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

func Open

func Open(dir string) (*Repo, error)

func (*Repo) Close

func (r *Repo) Close() error

func (*Repo) Update

func (r *Repo) Update(ot ObjectType, fn func(*Tx) error) error

func (*Repo) View

func (r *Repo) View(ot ObjectType, fn func(*Tx) error) error

type Tx

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

func (*Tx) AllocateId

func (tx *Tx) AllocateId() (uint64, error)

func (*Tx) Associate

func (tx *Tx) Associate(id uint64, name string) error

func (*Tx) Delete

func (tx *Tx) Delete(id uint64) error

func (*Tx) ForEach

func (tx *Tx) ForEach(fn func(uint64, []byte) error) error

func (*Tx) Get

func (tx *Tx) Get(id uint64) ([]byte, error)

func (*Tx) Lookup

func (tx *Tx) Lookup(name string) (uint64, error)

func (*Tx) Put

func (tx *Tx) Put(id uint64, v []byte) error

func (*Tx) Unassociate

func (tx *Tx) Unassociate(name string) error

Jump to

Keyboard shortcuts

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