mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-11 19:47:30 +02:00
etcd: fix typos
This commit is contained in:
@@ -92,7 +92,7 @@ func getKeyVal(kv *KV) ([]byte, []byte) {
|
|||||||
return getKey(kv.key), val
|
return getKey(kv.key), val
|
||||||
}
|
}
|
||||||
|
|
||||||
// BucketKey is a helper functon used in tests to create a bucket key from
|
// BucketKey is a helper function used in tests to create a bucket key from
|
||||||
// passed bucket list.
|
// passed bucket list.
|
||||||
func BucketKey(buckets ...string) string {
|
func BucketKey(buckets ...string) string {
|
||||||
var bucketKey []byte
|
var bucketKey []byte
|
||||||
|
@@ -22,7 +22,7 @@ const (
|
|||||||
// the etcd instance.
|
// the etcd instance.
|
||||||
etcdConnectionTimeout = 10 * time.Second
|
etcdConnectionTimeout = 10 * time.Second
|
||||||
|
|
||||||
// etcdLongTimeout is a timeout for longer taking etcd operatons.
|
// etcdLongTimeout is a timeout for longer taking etcd operations.
|
||||||
etcdLongTimeout = 30 * time.Second
|
etcdLongTimeout = 30 * time.Second
|
||||||
|
|
||||||
// etcdDefaultRootBucketId is used as the root bucket key. Note that
|
// etcdDefaultRootBucketId is used as the root bucket key. Note that
|
||||||
@@ -52,8 +52,8 @@ type commitStatsCollector struct {
|
|||||||
fail map[string]*callerStats
|
fail map[string]*callerStats
|
||||||
}
|
}
|
||||||
|
|
||||||
// newCommitStatsColletor creates a new commitStatsCollector instance.
|
// newCommitStatsCollector creates a new commitStatsCollector instance.
|
||||||
func newCommitStatsColletor() *commitStatsCollector {
|
func newCommitStatsCollector() *commitStatsCollector {
|
||||||
return &commitStatsCollector{
|
return &commitStatsCollector{
|
||||||
succ: make(map[string]*callerStats),
|
succ: make(map[string]*callerStats),
|
||||||
fail: make(map[string]*callerStats),
|
fail: make(map[string]*callerStats),
|
||||||
@@ -181,7 +181,7 @@ func newEtcdBackend(ctx context.Context, cfg Config) (*db, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if cfg.CollectStats {
|
if cfg.CollectStats {
|
||||||
backend.commitStatsCollector = newCommitStatsColletor()
|
backend.commitStatsCollector = newCommitStatsCollector()
|
||||||
}
|
}
|
||||||
|
|
||||||
return backend, nil
|
return backend, nil
|
||||||
|
@@ -41,8 +41,8 @@ func NewTestEtcdInstance(t *testing.T, path string) (*Config, func()) {
|
|||||||
return config, cleanup
|
return config, cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewTestEtcdTestFixture creates a new etcd-test fixture. This is helper
|
// NewEtcdTestFixture creates a new etcd-test fixture. This is helper
|
||||||
// object to facilitate etcd tests and ensure pre and post conditions.
|
// object to facilitate etcd tests and ensure pre- and post-conditions.
|
||||||
func NewEtcdTestFixture(t *testing.T) *EtcdTestFixture {
|
func NewEtcdTestFixture(t *testing.T) *EtcdTestFixture {
|
||||||
tmpDir := t.TempDir()
|
tmpDir := t.TempDir()
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ func (f *EtcdTestFixture) Dump() map[string]string {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
// BackendConfig returns the backend config for connecting to theembedded
|
// BackendConfig returns the backend config for connecting to the embedded
|
||||||
// etcd instance.
|
// etcd instance.
|
||||||
func (f *EtcdTestFixture) BackendConfig() Config {
|
func (f *EtcdTestFixture) BackendConfig() Config {
|
||||||
return *f.config
|
return *f.config
|
||||||
|
@@ -318,7 +318,7 @@ func (b *readWriteBucket) DeleteNestedBucket(key []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Put updates the value for the passed key.
|
// Put updates the value for the passed key.
|
||||||
// Returns ErrKeyRequred if te passed key is empty.
|
// Returns ErrKeyRequired if the passed key is empty.
|
||||||
func (b *readWriteBucket) Put(key, value []byte) error {
|
func (b *readWriteBucket) Put(key, value []byte) error {
|
||||||
if len(key) == 0 {
|
if len(key) == 0 {
|
||||||
return walletdb.ErrKeyRequired
|
return walletdb.ErrKeyRequired
|
||||||
@@ -335,7 +335,7 @@ func (b *readWriteBucket) Put(key, value []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete deletes the key/value pointed to by the passed key.
|
// Delete deletes the key/value pointed to by the passed key.
|
||||||
// Returns ErrKeyRequred if the passed key is empty.
|
// Returns ErrKeyRequired if the passed key is empty.
|
||||||
func (b *readWriteBucket) Delete(key []byte) error {
|
func (b *readWriteBucket) Delete(key []byte) error {
|
||||||
if key == nil {
|
if key == nil {
|
||||||
return nil
|
return nil
|
||||||
@@ -360,7 +360,7 @@ func (b *readWriteBucket) Tx() walletdb.ReadWriteTx {
|
|||||||
return b.tx
|
return b.tx
|
||||||
}
|
}
|
||||||
|
|
||||||
// NextSequence returns an autoincrementing sequence number for this bucket.
|
// NextSequence returns an auto-incrementing sequence number for this bucket.
|
||||||
// Note that this is not a thread safe function and as such it must not be used
|
// Note that this is not a thread safe function and as such it must not be used
|
||||||
// for synchronization.
|
// for synchronization.
|
||||||
func (b *readWriteBucket) NextSequence() (uint64, error) {
|
func (b *readWriteBucket) NextSequence() (uint64, error) {
|
||||||
@@ -396,7 +396,7 @@ func (b *readWriteBucket) Sequence() uint64 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise try to parse a 64 bit unsigned integer from the value.
|
// Otherwise try to parse a 64-bit unsigned integer from the value.
|
||||||
num, _ := strconv.ParseUint(string(val), 10, 64)
|
num, _ := strconv.ParseUint(string(val), 10, 64)
|
||||||
|
|
||||||
return num
|
return num
|
||||||
@@ -414,7 +414,7 @@ func flattenMap(m map[string]struct{}) []string {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prefetch will prefetch all keys in the passed paths as well as all bucket
|
// Prefetch will prefetch all keys in the passed-in paths as well as all bucket
|
||||||
// keys along the paths.
|
// keys along the paths.
|
||||||
func (b *readWriteBucket) Prefetch(paths ...[]string) {
|
func (b *readWriteBucket) Prefetch(paths ...[]string) {
|
||||||
keys := make(map[string]struct{})
|
keys := make(map[string]struct{})
|
||||||
|
Reference in New Issue
Block a user