badger

package
v0.0.0-...-0fc6d53 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright © 2018 Zhao Ming <mint.zhao.chiu@gmail.com>.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2018 Zhao Ming <mint.zhao.chiu@gmail.com>.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2018 Zhao Ming <mint.zhao.chiu@gmail.com>.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(dir string) (database.Database, error)

Types

type BadgerDB

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

func (*BadgerDB) Close

func (db *BadgerDB) Close() error

Close close database

func (*BadgerDB) Delete

func (db *BadgerDB) Delete(bucket, key string) error

Delete delete key/value from database

func (*BadgerDB) Get

func (db *BadgerDB) Get(bucket, key string) ([]byte, error)

Get get key/value pair from database

func (*BadgerDB) NewBatch

func (db *BadgerDB) NewBatch() (database.Batch, error)

NewBatch returns a Batch interface to handle multi key/value pairs writes.

func (*BadgerDB) NewIterator

func (db *BadgerDB) NewIterator(bucket, prefix string) (database.Iterator, error)

NewIterator iterate over a key prefix

func (*BadgerDB) Open

func (db *BadgerDB) Open() error

Open open database handler

func (*BadgerDB) Set

func (db *BadgerDB) Set(bucket, key string, value []byte) error

Set set key/value pair

Jump to

Keyboard shortcuts

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