localstorage

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Local

type Local struct {
	DB               *bolt.DB
	CompressionLevel int
}

func NewLocal

func NewLocal(path string) (*Local, error)
Example
package main

import (
	"github.com/adamluzsi/frameless/resources/storages/localstorage"
)

func main() {
	localstorage.NewLocal("path/to/local/db/file")
}
Output:

func (*Local) BucketNameFor

func (storage *Local) BucketNameFor(e frameless.Entity) []byte

func (*Local) Close

func (storage *Local) Close() error

Close the Local database and release the file lock

func (*Local) Create

func (storage *Local) Create(ctx context.Context, ptr interface{}) error

func (*Local) DeleteByID

func (storage *Local) DeleteByID(ctx context.Context, Type interface{}, ID string) error

func (*Local) Deserialize

func (storage *Local) Deserialize(CompressedAndSerialized []byte, ptr interface{}) error

func (*Local) FindAll

func (storage *Local) FindAll(ctx context.Context, Type interface{}) frameless.Iterator

func (*Local) FindByID

func (storage *Local) FindByID(ctx context.Context, ptr interface{}, ID string) (bool, error)

func (*Local) IDToBytes

func (storage *Local) IDToBytes(ID string) ([]byte, error)

func (*Local) Serialize

func (storage *Local) Serialize(e frameless.Entity) ([]byte, error)

func (*Local) Truncate

func (storage *Local) Truncate(ctx context.Context, Type interface{}) error

func (*Local) Update

func (storage *Local) Update(ctx context.Context, ptr interface{}) error

Jump to

Keyboard shortcuts

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