statusdb

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Domain      string    // 查询域名
	Dns         string    // 查询dns
	Time        time.Time // 发送时间
	Retry       int       // 重试次数
	DomainLevel int       // 域名层级
}

type StatusDb

type StatusDb struct {
	Items sync.Map
	// contains filtered or unexported fields
}

func CreateMemoryDB

func CreateMemoryDB() *StatusDb

内存简易读写数据库,自带锁机制

func (*StatusDb) Add

func (r *StatusDb) Add(domain string, tableData Item)

func (*StatusDb) Close

func (r *StatusDb) Close()

func (*StatusDb) Del

func (r *StatusDb) Del(domain string)

func (*StatusDb) Get

func (r *StatusDb) Get(domain string) (Item, bool)

func (*StatusDb) Length

func (r *StatusDb) Length() int64

func (*StatusDb) Scan

func (r *StatusDb) Scan(f func(key string, value Item) error)

func (*StatusDb) Set

func (r *StatusDb) Set(domain string, tableData Item)

Jump to

Keyboard shortcuts

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