boltbk

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright 2015 Gravitational, Inc.

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.

package boltbk implements BoltDB backed backend for standalone instances

Copyright 2015 Gravitational, Inc.

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 FromJSON

func FromJSON(paramsJSON string) (backend.Backend, error)

func FromObject

func FromObject(in interface{}) (backend.Backend, error)

FromString initialized the backend from backend-specific string

func GetBucket

func GetBucket(b *bolt.Tx, buckets []string) (*bolt.Bucket, error)

func UpsertBucket

func UpsertBucket(b *bolt.Tx, buckets []string) (*bolt.Bucket, error)

Types

type BoltBackend

type BoltBackend struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func New

func New(path string) (*BoltBackend, error)

func (*BoltBackend) AcquireLock

func (b *BoltBackend) AcquireLock(token string, ttl time.Duration) error

func (*BoltBackend) Close

func (b *BoltBackend) Close() error

func (*BoltBackend) CompareAndSwap

func (b *BoltBackend) CompareAndSwap(path []string, key string, val []byte, ttl time.Duration, prevVal []byte) ([]byte, error)

func (*BoltBackend) DeleteBucket

func (b *BoltBackend) DeleteBucket(path []string, bucket string) error

func (*BoltBackend) DeleteKey

func (b *BoltBackend) DeleteKey(path []string, key string) error

func (*BoltBackend) GetKeys

func (b *BoltBackend) GetKeys(path []string) ([]string, error)

func (*BoltBackend) GetVal

func (b *BoltBackend) GetVal(path []string, key string) ([]byte, error)

func (*BoltBackend) GetValAndTTL

func (b *BoltBackend) GetValAndTTL(path []string, key string) ([]byte, time.Duration, error)

func (*BoltBackend) ReleaseLock

func (b *BoltBackend) ReleaseLock(token string) error

func (*BoltBackend) UpsertVal

func (b *BoltBackend) UpsertVal(path []string, key string, val []byte, ttl time.Duration) error

Jump to

Keyboard shortcuts

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