lookup

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package lookup

@author: xwc1125

Package lookup

@author: xwc1125

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lookup

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

func NewLookup

func NewLookup(txConfig *PoolConfig, OnRemoveWithReason func(key string, entry []byte, reason bigcache.RemoveReason)) *Lookup

func (*Lookup) Add

func (tl *Lookup) Add(hash string, data []byte)

添加hash==> 节点peer

func (*Lookup) Del

func (tl *Lookup) Del(hash string)

func (*Lookup) Exist

func (tl *Lookup) Exist(hash string) bool

func (*Lookup) Get

func (tl *Lookup) Get(hash string) ([]byte, error)

func (*Lookup) GetAllKeys

func (tl *Lookup) GetAllKeys() []string

func (*Lookup) Len

func (tl *Lookup) Len() uint64

type PoolConfig

type PoolConfig struct {
	MaxTxSize uint64 // Max size of tx pool

	TxLifeTime time.Duration // 分钟
	TxTaskTime time.Duration // 刷新时间(秒)
}

func DefaultConfig

func DefaultConfig() *PoolConfig

Jump to

Keyboard shortcuts

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