conns

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package conns contains internal helpers relating to conn.Conns values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromSet

func FromSet(set Set) conn.Conns

FromSet converts a conn.Set to a conn.Conns.

func FromSlice

func FromSlice(conns []conn.Conn) conn.Conns

FromSlice returns a conn.Conns that represents the given slice. Note that no defensive copy is made, so changes to the given slice's contents will be reflected in the returned value.

Types

type Set

type Set map[conn.Conn]struct{}

Set is a set of connections. Since connections are map keys in the underlying type, they are unique. Standard map iteration is used to enumerate the contents of the set.

func SetFromSlice

func SetFromSlice(conns []conn.Conn) Set

SetFromSlice converts a []conn.Conn into a conn.Set.

func ToSet

func ToSet(conns conn.Conns) Set

ToSet converts a conn.Conns into a conn.Set.

func (Set) Contains

func (s Set) Contains(c conn.Conn) bool

Contains returns true if the set contains the given connection.

func (Set) Equals

func (s Set) Equals(other Set) bool

Equals returns true if s has the same connections as other.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL