memo

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteView

type ByteView struct {
	B []byte
}

ByteView data will store in ByteView form

func (ByteView) ByteSlice

func (v ByteView) ByteSlice() []byte

ByteSlice returns the copy of the data as a byte slice

func (ByteView) Len

func (v ByteView) Len() int

Len returns the length of the data

func (ByteView) String

func (v ByteView) String() string

String returns the data as a string

type Memo

type Memo struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Memo ensures that all accesses to the guidance are concurrency safe Memo is an encapsulation of the strategy layer

func NewMemo

func NewMemo(core eliminate.ICore) *Memo

NewMemo return a new memo base on eliminate layer

func (*Memo) Add

func (m *Memo) Add(key eliminate.Key, value ByteView)

Add to strategy.ICore

func (*Memo) Clear

func (m *Memo) Clear()

Clear memo entities

func (*Memo) Get

func (m *Memo) Get(key eliminate.Key) (ByteView, bool)

Get from strategy.ICore

func (*Memo) Remove

func (m *Memo) Remove(key eliminate.Key)

Remove memo entity

Jump to

Keyboard shortcuts

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