Skip to content

Commit 6a53da6

Browse files
authored
GODRIVER-3180 Document clearly that x/ package APIs are not stable. (#1631)
1 parent 1e76182 commit 6a53da6

File tree

17 files changed

+166
-59
lines changed

17 files changed

+166
-59
lines changed

x/README.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
# MongoDB Go Driver Unstable Libraries
1+
# MongoDB Go Driver Experimental Packages
22

3-
This directory contains unstable MongoDB Go driver libraries and packages. The APIs of these
4-
packages are not stable and there is no backward compatibility guarantee.
3+
**WARNING: THESE PACKAGES ARE EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED
4+
WITHOUT NOTICE.**
55

6-
**THESE PACKAGES ARE EXPERIMENTAL AND SUBJECT TO CHANGE.**
6+
This directory contains packages intended only for internal use. They are made
7+
available to facilitate use cases that require access to internal MongoDB driver
8+
functionality and state. The APIs of these packages are not stable and there is
9+
no backward compatibility guarantee. Use with extreme caution!

x/bsonx/bsoncore/doc.go

+14-9
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,31 @@
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.
7+
// Package bsoncore is intended for internal use only. It is made available to
8+
// facilitate use cases that require access to internal MongoDB driver
9+
// functionality and state. The API of this package is not stable and there is
10+
// no backward compatibility guarantee.
11+
//
12+
// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT
13+
// NOTICE! USE WITH EXTREME CAUTION!
14+
//
15+
// Package bsoncore contains functions that can be used to encode and decode
16+
// BSON elements and values to or from a slice of bytes. These functions are
17+
// aimed at allowing low level manipulation of BSON and can be used to build a
18+
// higher level BSON library.
1119
//
1220
// The Read* functions within this package return the values of the element and
1321
// a boolean indicating if the values are valid. A boolean was used instead of
1422
// an error because any error that would be returned would be the same: not
1523
// enough bytes. This library attempts to do no validation, it will only return
1624
// false if there are not enough bytes for an item to be read. For example, the
1725
// 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
26+
// number of bytes available, it will return false, if there are enough bytes,
27+
// it will return those bytes and true. It is the consumers responsibility to
2028
// validate those bytes.
2129
//
2230
// The Append* functions within this package will append the type value to the
2331
// given dst slice. If the slice has enough capacity, it will not grow the
2432
// slice. The Append*Element functions within this package operate in the same
2533
// 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.
2934
package bsoncore

x/mongo/driver/DESIGN.md

-27
This file was deleted.

x/mongo/driver/auth/creds/doc.go

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright (C) MongoDB, Inc. 2024-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 creds is intended for internal use only. It is made available to
8+
// facilitate use cases that require access to internal MongoDB driver
9+
// functionality and state. The API of this package is not stable and there is
10+
// no backward compatibility guarantee.
11+
//
12+
// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT
13+
// NOTICE! USE WITH EXTREME CAUTION!
14+
package creds

x/mongo/driver/auth/doc.go

+6-15
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,11 @@
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 auth is not for public use.
7+
// Package auth is intended for internal use only. It is made available to
8+
// facilitate use cases that require access to internal MongoDB driver
9+
// functionality and state. The API of this package is not stable and there is
10+
// no backward compatibility guarantee.
811
//
9-
// The API for packages in the 'private' directory have no stability
10-
// guarantee.
11-
//
12-
// The packages within the 'private' directory would normally be put into an
13-
// 'internal' directory to prohibit their use outside the 'mongo' directory.
14-
// However, some MongoDB tools require very low-level access to the building
15-
// blocks of a driver, so we have placed them under 'private' to allow these
16-
// packages to be imported by projects that need them.
17-
//
18-
// These package APIs may be modified in backwards-incompatible ways at any
19-
// time.
20-
//
21-
// You are strongly discouraged from directly using any packages
22-
// under 'private'.
12+
// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT
13+
// NOTICE! USE WITH EXTREME CAUTION!
2314
package auth

x/mongo/driver/connstring/connstring.go

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
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 connstring is intended for internal use only. It is made available to
8+
// facilitate use cases that require access to internal MongoDB driver
9+
// functionality and state. The API of this package is not stable and there is
10+
// no backward compatibility guarantee.
11+
//
12+
// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT
13+
// NOTICE! USE WITH EXTREME CAUTION!
714
package connstring // import "go.mongodb.org/mongo-driver/x/mongo/driver/connstring"
815

916
import (

x/mongo/driver/dns/dns.go

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
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 dns is intended for internal use only. It is made available to
8+
// facilitate use cases that require access to internal MongoDB driver
9+
// functionality and state. The API of this package is not stable and there is
10+
// no backward compatibility guarantee.
11+
//
12+
// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT
13+
// NOTICE! USE WITH EXTREME CAUTION!
714
package dns
815

916
import (

x/mongo/driver/driver.go

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
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 driver is intended for internal use only. It is made available to
8+
// facilitate use cases that require access to internal MongoDB driver
9+
// functionality and state. The API of this package is not stable and there is
10+
// no backward compatibility guarantee.
11+
//
12+
// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT
13+
// NOTICE! USE WITH EXTREME CAUTION!
714
package driver // import "go.mongodb.org/mongo-driver/x/mongo/driver"
815

916
import (

x/mongo/driver/drivertest/doc.go

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright (C) MongoDB, Inc. 2024-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 drivertest is intended for internal use only. It is made available to
8+
// facilitate use cases that require access to internal MongoDB driver
9+
// functionality and state. The API of this package is not stable and there is
10+
// no backward compatibility guarantee.
11+
//
12+
// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT
13+
// NOTICE! USE WITH EXTREME CAUTION!
14+
package drivertest

x/mongo/driver/integration/doc.go

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright (C) MongoDB, Inc. 2024-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 integration is intended for internal use only. It is made available
8+
// to facilitate use cases that require access to internal MongoDB driver
9+
// functionality and state. The API of this package is not stable and there is
10+
// no backward compatibility guarantee.
11+
//
12+
// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT
13+
// NOTICE! USE WITH EXTREME CAUTION!
14+
package integration

x/mongo/driver/mongocrypt/mongocrypt_not_enabled.go

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
//go:build !cse
88
// +build !cse
99

10+
// Package mongocrypt is intended for internal use only. It is made available to
11+
// facilitate use cases that require access to internal MongoDB driver
12+
// functionality and state. The API of this package is not stable and there is
13+
// no backward compatibility guarantee.
14+
//
15+
// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT
16+
// NOTICE! USE WITH EXTREME CAUTION!
1017
package mongocrypt
1118

1219
import (
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright (C) MongoDB, Inc. 2024-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 options is intended for internal use only. It is made available to
8+
// facilitate use cases that require access to internal MongoDB driver
9+
// functionality and state. The API of this package is not stable and there is
10+
// no backward compatibility guarantee.
11+
//
12+
// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT
13+
// NOTICE! USE WITH EXTREME CAUTION!
14+
package options

x/mongo/driver/ocsp/ocsp.go

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
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 ocsp is intended for internal use only. It is made available to
8+
// facilitate use cases that require access to internal MongoDB driver
9+
// functionality and state. The API of this package is not stable and there is
10+
// no backward compatibility guarantee.
11+
//
12+
// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT
13+
// NOTICE! USE WITH EXTREME CAUTION!
714
package ocsp
815

916
import (

x/mongo/driver/operation/doc.go

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright (C) MongoDB, Inc. 2024-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 operation is intended for internal use only. It is made available to
8+
// facilitate use cases that require access to internal MongoDB driver
9+
// functionality and state. The API of this package is not stable and there is
10+
// no backward compatibility guarantee.
11+
//
12+
// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT
13+
// NOTICE! USE WITH EXTREME CAUTION!
14+
package operation

x/mongo/driver/session/doc.go

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright (C) MongoDB, Inc. 2024-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 session is intended for internal use only. It is made available to
8+
// facilitate use cases that require access to internal MongoDB driver
9+
// functionality and state. The API of this package is not stable and there is
10+
// no backward compatibility guarantee.
11+
//
12+
// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT
13+
// NOTICE! USE WITH EXTREME CAUTION!
14+
package session

x/mongo/driver/topology/topology.go

+13-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,19 @@
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 topology contains types that handles the discovery, monitoring, and selection
8-
// of servers. This package is designed to expose enough inner workings of service discovery
9-
// and monitoring to allow low level applications to have fine grained control, while hiding
10-
// most of the detailed implementation of the algorithms.
7+
// Package topology is intended for internal use only. It is made available to
8+
// facilitate use cases that require access to internal MongoDB driver
9+
// functionality and state. The API of this package is not stable and there is
10+
// no backward compatibility guarantee.
11+
//
12+
// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT
13+
// NOTICE! USE WITH EXTREME CAUTION!
14+
//
15+
// Package topology contains types that handles the discovery, monitoring, and
16+
// selection of servers. This package is designed to expose enough inner
17+
// workings of service discovery and monitoring to allow low level applications
18+
// to have fine grained control, while hiding most of the detailed
19+
// implementation of the algorithms.
1120
package topology // import "go.mongodb.org/mongo-driver/x/mongo/driver/topology"
1221

1322
import (

x/mongo/driver/wiremessage/wiremessage.go

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
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 wiremessage is intended for internal use only. It is made available
8+
// to facilitate use cases that require access to internal MongoDB driver
9+
// functionality and state. The API of this package is not stable and there is
10+
// no backward compatibility guarantee.
11+
//
12+
// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT
13+
// NOTICE! USE WITH EXTREME CAUTION!
714
package wiremessage
815

916
import (

0 commit comments

Comments
 (0)