syncx

package module
Version: v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: MIT Imports: 2 Imported by: 1

README

GoDoc Go Report Card

github.com/gobuffalo/syncx

This package provides a set of types and tools for working in current environments.

See https://godoc.org/github.com/gobuffalo/syncx for more details.

Installation

$ go get github.com/gobuffalo/syncx

Documentation

Index

Constants

View Source
const Version = "v0.1.0"

Version of syncx

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteMap

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

ByteMap wraps sync.Map and uses the following types: key: string value: []byte

func (*ByteMap) Delete

func (m *ByteMap) Delete(key string)

Delete the key from the map

func (*ByteMap) Keys

func (m *ByteMap) Keys() []string

Keys returns a list of keys in the map

func (*ByteMap) Load

func (m *ByteMap) Load(key string) ([]byte, bool)

Load the key from the map. Returns []byte or bool. A false return indicates either the key was not found or the value is not of type []byte

func (*ByteMap) LoadOrStore

func (m *ByteMap) LoadOrStore(key string, value []byte) ([]byte, bool)

LoadOrStore will return an existing key or store the value if not already in the map

func (*ByteMap) Range

func (m *ByteMap) Range(f func(key string, value []byte) bool)

Range over the []byte values in the map

func (*ByteMap) Store

func (m *ByteMap) Store(key string, value []byte)

Store a []byte in the map

type IntMap

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

IntMap wraps sync.Map and uses the following types: key: string value: int

func (*IntMap) Delete

func (m *IntMap) Delete(key string)

Delete the key from the map

func (*IntMap) Keys

func (m *IntMap) Keys() []string

Keys returns a list of keys in the map

func (*IntMap) Load

func (m *IntMap) Load(key string) (int, bool)

Load the key from the map. Returns int or bool. A false return indicates either the key was not found or the value is not of type int

func (*IntMap) LoadOrStore

func (m *IntMap) LoadOrStore(key string, value int) (int, bool)

LoadOrStore will return an existing key or store the value if not already in the map

func (*IntMap) Range

func (m *IntMap) Range(f func(key string, value int) bool)

Range over the int values in the map

func (*IntMap) Store

func (m *IntMap) Store(key string, value int)

Store a int in the map

type Map

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

Map wraps sync.Map and uses the following types: key: string value: interface{}

func (*Map) Delete

func (m *Map) Delete(key string)

Delete the key from the map

func (*Map) Keys

func (m *Map) Keys() []string

Keys returns a list of keys in the map

func (*Map) Load

func (m *Map) Load(key string) (interface{}, bool)

Load the key from the map. Returns interface{} or bool. A false return indicates either the key was not found or the value is not of type interface{}

func (*Map) LoadOrStore

func (m *Map) LoadOrStore(key string, value interface{}) (interface{}, bool)

LoadOrStore will return an existing key or store the value if not already in the map

func (*Map) Range

func (m *Map) Range(f func(key string, value interface{}) bool)

Range over the interface{} values in the map

func (*Map) Store

func (m *Map) Store(key string, value interface{})

Store a interface{} in the map

type StringMap

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

StringMap wraps sync.Map and uses the following types: key: string value: string

func (*StringMap) Delete

func (m *StringMap) Delete(key string)

Delete the key from the map

func (*StringMap) Keys

func (m *StringMap) Keys() []string

Keys returns a list of keys in the map

func (*StringMap) Load

func (m *StringMap) Load(key string) (string, bool)

Load the key from the map. Returns string or bool. A false return indicates either the key was not found or the value is not of type string

func (*StringMap) LoadOrStore

func (m *StringMap) LoadOrStore(key string, value string) (string, bool)

LoadOrStore will return an existing key or store the value if not already in the map

func (*StringMap) Range

func (m *StringMap) Range(f func(key string, value string) bool)

Range over the string values in the map

func (*StringMap) Store

func (m *StringMap) Store(key string, value string)

Store a string in the map

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL