diffHostList (topology/diff.go)

mongo-go-driver · x/mongo/driver/topology/diff.go · go · Apache-2.0
database

Compares MongoDB topology descriptions to identify added/removed servers for connection management.

// Source: https://github.com/mongodb/mongo-go-driver | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
// Copyright (C) MongoDB, Inc. 2017-present.
//
// 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

package topology

import "go.mongodb.org/mongo-driver/v2/x/mongo/driver/description"

// hostlistDiff is the difference between a topology and a host list.
type hostlistDiff struct {
	Added   []string
	Removed []string
}

// diffHostList compares the topology description and host list and returns the difference.
fun

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key