package types
import "go.etcd.io/etcd/client/pkg/v3/types"
Package types declares various data types and implements type-checking functions.
Index ¶
- func NewThreadsafeSet(values ...string) *tsafeSet
- func NewUnsafeSet(values ...string) *unsafeSet
- type ID
- type IDSlice
- type Set
- type URLs
- func MustNewURLs(strs []string) URLs
- func NewURLs(strs []string) (URLs, error)
- func (us URLs) Len() int
- func (us URLs) Less(i, j int) bool
- func (us *URLs) Sort()
- func (us URLs) String() string
- func (us URLs) StringSlice() []string
- func (us URLs) Swap(i, j int)
- type URLsMap
- func NewURLsMap(s string) (URLsMap, error)
- func NewURLsMapFromStringMap(m map[string]string, sep string) (URLsMap, error)
- func (c URLsMap) Len() int
- func (c URLsMap) String() string
- func (c URLsMap) URLs() []string
- type Uint64Slice
Functions ¶
func NewThreadsafeSet ¶
func NewThreadsafeSet(values ...string) *tsafeSet
func NewUnsafeSet ¶
func NewUnsafeSet(values ...string) *unsafeSet
Types ¶
type ID ¶
type ID uint64
ID represents a generic identifier which is canonically stored as a uint64 but is typically represented as a base-16 string for input/output
func IDFromString ¶
IDFromString attempts to create an ID from a base-16 string.
func (ID) String ¶
type IDSlice ¶
type IDSlice []ID
IDSlice implements the sort interface
func (IDSlice) Len ¶
func (IDSlice) Less ¶
func (IDSlice) Swap ¶
type Set ¶
type Set interface { Add(string) Remove(string) Contains(string) bool Equals(Set) bool Length() int Values() []string Copy() Set Sub(Set) Set }
type URLs ¶
func MustNewURLs ¶
func NewURLs ¶
func (URLs) Len ¶
func (URLs) Less ¶
func (*URLs) Sort ¶
func (us *URLs) Sort()
func (URLs) String ¶
func (URLs) StringSlice ¶
func (URLs) Swap ¶
type URLsMap ¶
URLsMap is a map from a name to its URLs.
func NewURLsMap ¶
NewURLsMap returns a URLsMap instantiated from the given string, which consists of discovery-formatted names-to-URLs, like: mach0=http://1.1.1.1:2380,mach0=http://2.2.2.2::2380,mach1=http://3.3.3.3:2380,mach2=http://4.4.4.4:2380
func NewURLsMapFromStringMap ¶
NewURLsMapFromStringMap takes a map of strings and returns a URLsMap. The string values in the map can be multiple values separated by the sep string.
func (URLsMap) Len ¶
Len returns the size of URLsMap.
func (URLsMap) String ¶
String turns URLsMap into discovery-formatted name-to-URLs sorted by name.
func (URLsMap) URLs ¶
URLs returns a list of all URLs. The returned list is sorted in ascending lexicographical order.
type Uint64Slice ¶
type Uint64Slice []uint64
Uint64Slice implements sort interface
func (Uint64Slice) Len ¶
func (p Uint64Slice) Len() int
func (Uint64Slice) Less ¶
func (p Uint64Slice) Less(i, j int) bool
func (Uint64Slice) Swap ¶
func (p Uint64Slice) Swap(i, j int)
Source Files ¶
doc.go id.go set.go slice.go urls.go urlsmap.go
- Version
- v3.5.18 (latest)
- Published
- Jan 24, 2025
- Platform
- linux/amd64
- Imports
- 9 packages
- Last checked
- 4 days ago –
Tools for package owners.