maps

package
v0.5.18 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package map は、カスタムマップを定義しています。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SafeMap

type SafeMap[K any, V any] struct {
	// contains filtered or unexported fields
}

SafeMap は、sync.Mapをラップしジェネリックにしたものです。

内部で sync.Map を内包しています。

REFERENCES

func (*SafeMap[K, V]) Load

func (me *SafeMap[K, V]) Load(key K) (V, bool)

Load は、指定したキーに紐づく値を取得します。

func (*SafeMap[K, V]) Range

func (me *SafeMap[K, V]) Range(fn func(key K, value V) bool)

Range は、自身をイテレーションし要素毎に fn を呼び出します。

func (*SafeMap[K, V]) Store

func (me *SafeMap[K, V]) Store(key K, value V)

Store は、指定したキーと値を保存します。

Jump to

Keyboard shortcuts

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