Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateTLSConfigForClient ¶ added in v0.3.0
func GenerateTLSConfigForServer ¶ added in v0.3.0
GenerateTLSConfigForServer 生成tls证书
func IsSameAddr ¶ added in v0.3.1
IsSameAddr 判断两个地址是否相同
Types ¶
type FakeAddr ¶ added in v0.3.0
type FakeAddr struct {
// contains filtered or unexported fields
}
FakeAddr 是一个虚地址对象,实现了net.Add
func NewFakeAddr ¶ added in v0.3.0
NewFakeAddr 创建一个虚地址对象
func NewFakeAddr2 ¶ added in v0.3.0
NewFakeAddr2 创建另一个不同参数的虚地址对象
func (*FakeAddr) SetUdpAddr ¶ added in v0.3.0
type Map ¶
type Map interface {
// Load returns the value stored in the map for a key, or nil if no
// value is present.
// The ok result indicates whether value was found in the map.
Load(key interface{}) (value interface{}, ok bool)
// Store sets the value for a key.
Store(key, value interface{})
// LoadOrStore returns the existing value for the key if present.
// Otherwise, it stores and returns the given value.
// The loaded result is true if the value was loaded, false if stored.
LoadOrStore(key, value interface{}) (actual interface{}, loaded bool)
// Range calls f sequentially for each key and value present in the map.
// If f returns false, range stops the iteration.
Range(f func(key, value interface{}) bool)
// Random returns a pair kv randomly.
// If exist=false, no kv data is exist.
Random() (key, value interface{}, exist bool)
// Delete deletes the value for a key.
Delete(key interface{})
// Clear clears all current data in the map.
Clear()
// Len returns the length of the map.
Len() int
}
Map is a concurrent map with loads, stores, and deletes. It is safe for multiple goroutines to call a Map's methods concurrently.
Click to show internal directories.
Click to hide internal directories.