pair

package module
v0.0.0-...-a3bb688 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: MIT Imports: 2 Imported by: 0

README

pair-go

pair-go is aimed to provide zero memory allocated name and value struct which is named pair

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pair

type Pair struct {
	// contains filtered or unexported fields
}

Pair represents the name and value

func (*Pair) Lock

func (*Pair) Lock()

func (*Pair) Unlock

func (*Pair) Unlock()

type Pairs

type Pairs struct {
	// contains filtered or unexported fields
}

Pairs holds slice of Pair

func (*Pairs) Add

func (q *Pairs) Add(name, value []byte)

Add adds the value

func (*Pairs) Del

func (q *Pairs) Del(name []byte)

Del dels the name

func (*Pairs) DelAll

func (q *Pairs) DelAll(name []byte)

DelAll dels all the value who name is equal to name

func (*Pairs) Get

func (q *Pairs) Get(name []byte) ([]byte, bool)

Get gets the value from name

func (*Pairs) GetAll

func (q *Pairs) GetAll(name []byte, fn func(value []byte) bool)

GetAll returns all Pairs who name is equal to name

func (*Pairs) Len

func (q *Pairs) Len() int

Len returns the length ofPairs

func (*Pairs) Lock

func (*Pairs) Lock()

func (*Pairs) Range

func (q *Pairs) Range(fn func(name, value []byte) bool)

Range ranges the name

func (*Pairs) Reset

func (q *Pairs) Reset()

Reset resets thePairs

func (*Pairs) Set

func (q *Pairs) Set(name, value []byte)

Set sets or adds the name

func (*Pairs) String

func (q *Pairs) String(sep string) string

String returns the string representation of pairs.

func (*Pairs) Unlock

func (*Pairs) Unlock()

Jump to

Keyboard shortcuts

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