sync_demo

package
v0.0.0-...-9d41389 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetterFunc

type GetterFunc func(key string) string

type SingleMap

type SingleMap struct {
	// data store
	*sync.Map

	// 防止缓存击穿 avoid cache breakdown
	*singleflight.Group
	// contains filtered or unexported fields
}

SingleMap 避免缓存击穿的map

func NewSingleMap

func NewSingleMap(getterFunc GetterFunc) *SingleMap

func (*SingleMap) Get

func (s *SingleMap) Get(key string) (string, error)

Jump to

Keyboard shortcuts

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