MCPcopy
hub / github.com/etcd-io/bbolt / CreateBucket

Method CreateBucket

tx.go:118–120  ·  tx.go::Tx.CreateBucket

CreateBucket creates a new bucket. Returns an error if the bucket already exists, if the bucket name is blank, or if the bucket name is too long. The bucket instance is only valid for the lifetime of the transaction.

(name []byte)

Source from the content-addressed store, hash-verified

116// Returns an error if the bucket already exists, if the bucket name is blank, or if the bucket name is too long.
117// The bucket instance is only valid for the lifetime of the transaction.
118func (tx *Tx) CreateBucket(name []byte) (*Bucket, error) {
119 return tx.root.CreateBucket(name)
120}
121
122// CreateBucketIfNotExists creates a new bucket if it doesn't already exist.
123// Returns an error if the bucket name is blank, or if the bucket name is too long.

Callers 15

dumpBucketFunction · 0.45
cloneBucketFunction · 0.45
TestCursor_BucketFunction · 0.45
TestCursor_SeekFunction · 0.45
TestCursor_DeleteFunction · 0.45
TestCursor_Seek_LargeFunction · 0.45
TestCursor_EmptyBucketFunction · 0.45
TestCursor_Iterate_LeafFunction · 0.45
TestCursor_RestartFunction · 0.45

Calls

no outgoing calls

Tested by 15

dumpBucketFunction · 0.36
cloneBucketFunction · 0.36
TestCursor_BucketFunction · 0.36
TestCursor_SeekFunction · 0.36
TestCursor_DeleteFunction · 0.36
TestCursor_Seek_LargeFunction · 0.36
TestCursor_EmptyBucketFunction · 0.36
TestCursor_Iterate_LeafFunction · 0.36
TestCursor_RestartFunction · 0.36