Documentation ¶
Index ¶
- Variables
- func GenerateSelfSignedCert(org string, hosts ...string) (tls.Certificate, error)
- func NewFlusher(conn net.Conn) io.Writer
- func NewFlusherWithKeepAlive(conn net.Conn, keepalive []byte, keepalivePeriod time.Duration) io.Writer
- func RandomString(length int) string
- func Recover() bool
- func ReleaseBuffer(b *Buffer)
- func ReleaseTimer(t *time.Timer)
- func StatBuffers()
- func TakeTimer() *time.Timer
- func Trace() bool
- type Buffer
- func CompressGZIP(src *Buffer, preallocate uint, level int) (dst *Buffer, err error)
- func CompressLZW(src *Buffer, preallocate uint) (dst *Buffer, err error)
- func CompressZLIB(src *Buffer, preallocate uint) (dst *Buffer, err error)
- func DecompressGZIP(src *Buffer, skip uint) (dst *Buffer, err error)
- func DecompressLZW(src *Buffer, skip uint) (dst *Buffer, err error)
- func DecompressZLIB(src *Buffer, skip uint) (dst *Buffer, err error)
- func TakeBuffer() *Buffer
- func (b *Buffer) Allocate(n int)
- func (b *Buffer) Append(v []byte)
- func (b *Buffer) AppendByte(v byte)
- func (b *Buffer) AppendString(s string)
- func (b *Buffer) Cap() int
- func (b *Buffer) Extend(n int) []byte
- func (b *Buffer) Len() int
- func (b *Buffer) Read(v []byte) (n int, err error)
- func (b *Buffer) ReadDataFrom(r io.Reader, limit int) (int, error)
- func (b *Buffer) Reset()
- func (b *Buffer) Set(v []byte)
- func (b *Buffer) String() string
- func (b *Buffer) Write(v []byte) (n int, err error)
- func (b *Buffer) WriteDataTo(w io.Writer) error
- type ItemMPSC
- type Map
- func (m *Map[K, V]) Delete(key K)
- func (m *Map[K, V]) DeleteNoLock(key K)
- func (m *Map[K, V]) Len() int
- func (m *Map[K, V]) Load(key K) (V, bool)
- func (m *Map[K, V]) LoadAndDelete(key K) (V, bool)
- func (m *Map[K, V]) LoadOrStore(key K, value V) (V, bool)
- func (m *Map[K, V]) Range(f func(k K, v V) bool)
- func (m *Map[K, V]) RangeLock(f func(k K, v V) bool)
- func (m *Map[K, V]) Store(key K, value V)
- type QueueMPSC
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultBufferLength = 4096
)
Functions ¶
func GenerateSelfSignedCert ¶
func GenerateSelfSignedCert(org string, hosts ...string) (tls.Certificate, error)
GenerateSelfSignedCert
func NewFlusherWithKeepAlive ¶
func StatBuffers ¶
func StatBuffers()
Types ¶
type Buffer ¶
type Buffer struct { B []byte // contains filtered or unexported fields }
Buffer
func CompressGZIP ¶
CompressGZIP level: 0 - default, 1 - best speed, 2 - best size
func CompressLZW ¶
CompressLZW
func CompressZLIB ¶
CompressZLIB
func (*Buffer) ReadDataFrom ¶
ReadDataFrom
type Map ¶
type Map[K comparable, V any] struct { sync.RWMutex // contains filtered or unexported fields }
func (*Map[K, V]) DeleteNoLock ¶
func (m *Map[K, V]) DeleteNoLock(key K)
DeleteNoLock to be used within RangeLock method
func (*Map[K, V]) LoadAndDelete ¶
func (*Map[K, V]) LoadOrStore ¶
type QueueMPSC ¶
type QueueMPSC interface { Push(value any) bool Pop() (any, bool) Item() ItemMPSC // Len returns the number of items in the queue Len() int64 // Size returns the limit for the queue. -1 - for unlimited Size() int64 Lock() bool Unlock() bool }
func NewQueueLimitMPSC ¶
NewQueueLimitMPSC creates MPSC queue with limited length. Enabling "flush" options makes this queue flush out the tail item if the limit has been reached. Warning: enabled "flush" option also makes this queue unusable for the concurrent environment
func NewQueueMPSC ¶
func NewQueueMPSC() QueueMPSC
Source Files ¶
Click to show internal directories.
Click to hide internal directories.