Skip to content

Commit eff5307

Browse files
authored
GODRIVER-1317 Document that the 'bsoncore' package is experimental. (#1138)
1 parent 766f828 commit eff5307

File tree

2 files changed

+29
-19
lines changed

2 files changed

+29
-19
lines changed

x/bsonx/bsoncore/bsoncore.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,6 @@
44
// not use this file except in compliance with the License. You may obtain
55
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
66

7-
// Package bsoncore contains functions that can be used to encode and decode BSON
8-
// elements and values to or from a slice of bytes. These functions are aimed at
9-
// allowing low level manipulation of BSON and can be used to build a higher
10-
// level BSON library.
11-
//
12-
// The Read* functions within this package return the values of the element and
13-
// a boolean indicating if the values are valid. A boolean was used instead of
14-
// an error because any error that would be returned would be the same: not
15-
// enough bytes. This library attempts to do no validation, it will only return
16-
// false if there are not enough bytes for an item to be read. For example, the
17-
// ReadDocument function checks the length, if that length is larger than the
18-
// number of bytes available, it will return false, if there are enough bytes, it
19-
// will return those bytes and true. It is the consumers responsibility to
20-
// validate those bytes.
21-
//
22-
// The Append* functions within this package will append the type value to the
23-
// given dst slice. If the slice has enough capacity, it will not grow the
24-
// slice. The Append*Element functions within this package operate in the same
25-
// way, but additionally append the BSON type and the key before the value.
267
package bsoncore // import "go.mongodb.org/mongo-driver/x/bsonx/bsoncore"
278

289
import (

x/bsonx/bsoncore/doc.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (C) MongoDB, Inc. 2022-present.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License"); you may
4+
// not use this file except in compliance with the License. You may obtain
5+
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
7+
// Package bsoncore contains functions that can be used to encode and decode BSON
8+
// elements and values to or from a slice of bytes. These functions are aimed at
9+
// allowing low level manipulation of BSON and can be used to build a higher
10+
// level BSON library.
11+
//
12+
// The Read* functions within this package return the values of the element and
13+
// a boolean indicating if the values are valid. A boolean was used instead of
14+
// an error because any error that would be returned would be the same: not
15+
// enough bytes. This library attempts to do no validation, it will only return
16+
// false if there are not enough bytes for an item to be read. For example, the
17+
// ReadDocument function checks the length, if that length is larger than the
18+
// number of bytes available, it will return false, if there are enough bytes, it
19+
// will return those bytes and true. It is the consumers responsibility to
20+
// validate those bytes.
21+
//
22+
// The Append* functions within this package will append the type value to the
23+
// given dst slice. If the slice has enough capacity, it will not grow the
24+
// slice. The Append*Element functions within this package operate in the same
25+
// way, but additionally append the BSON type and the key before the value.
26+
//
27+
// Warning: Package bsoncore is unstable and there is no backward compatibility
28+
// guarantee. It is experimental and subject to change.
29+
package bsoncore

0 commit comments

Comments
 (0)