Documentation ¶
Overview ¶
Package boltbk implements BoltDB backed backend for standalone instances and test mode, you should use Etcd in production
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 ¶
- func FromJSON(paramsJSON string) (backend.Backend, error)
- func FromObject(in interface{}) (backend.Backend, error)
- func GetBucket(b *bolt.Tx, buckets []string) (*bolt.Bucket, error)
- func UpsertBucket(b *bolt.Tx, buckets []string) (*bolt.Bucket, error)
- type BoltBackend
- func (b *BoltBackend) AcquireLock(token string, ttl time.Duration) error
- func (b *BoltBackend) Close() error
- func (b *BoltBackend) CompareAndSwap(path []string, key string, val []byte, ttl time.Duration, prevVal []byte) ([]byte, error)
- func (b *BoltBackend) CreateVal(bucket []string, key string, val []byte, ttl time.Duration) error
- func (b *BoltBackend) DeleteBucket(path []string, bucket string) error
- func (b *BoltBackend) DeleteKey(path []string, key string) error
- func (b *BoltBackend) GetKeys(path []string) ([]string, error)
- func (b *BoltBackend) GetVal(path []string, key string) ([]byte, error)
- func (b *BoltBackend) GetValAndTTL(path []string, key string) ([]byte, time.Duration, error)
- func (b *BoltBackend) ReleaseLock(token string) error
- func (b *BoltBackend) TouchVal(bucket []string, key string, ttl time.Duration) error
- func (b *BoltBackend) UpsertVal(path []string, key string, val []byte, ttl time.Duration) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromObject ¶
FromString initialized the backend from backend-specific string
Types ¶
type BoltBackend ¶
BoltBackend is a boltdb-based backend used in tests and standalone mode
func New ¶
func New(path string, opts ...Option) (*BoltBackend, error)
New returns a new isntance of bolt backend
func (*BoltBackend) AcquireLock ¶
func (b *BoltBackend) AcquireLock(token string, ttl time.Duration) error
func (*BoltBackend) CompareAndSwap ¶
func (*BoltBackend) DeleteBucket ¶
func (b *BoltBackend) DeleteBucket(path []string, bucket string) error
func (*BoltBackend) GetVal ¶
func (b *BoltBackend) GetVal(path []string, key string) ([]byte, error)
func (*BoltBackend) GetValAndTTL ¶
func (*BoltBackend) ReleaseLock ¶
func (b *BoltBackend) ReleaseLock(token string) error
type Option ¶ added in v1.0.0
type Option func(b *BoltBackend) error
Option sets functional options for the backend
func Clock ¶ added in v1.0.0
func Clock(clock timetools.TimeProvider) Option
Clock sets clock for the backend, used in tests