names

package
v0.0.0-...-18b760a Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2025 License: GPL-3.0 Imports: 17 Imported by: 1

Documentation

Overview

Package names caries the names database

Index

Constants

View Source
const (
	NameWriterCsv nameWriterFormat = iota
	NameWriterTsv
)

Variables

This section is empty.

Functions

func BaddressCount

func BaddressCount() int

func ClearCache

func ClearCache()

ClearCache removes names that are cached in-memory

func ClearCustomNames

func ClearCustomNames()

func CreateName

func CreateName(dbType DatabaseType, chain string, name *types.Name) (err error)

func CustomWriteNames

func CustomWriteNames(chain string, dryRun bool) (err error)

func LoadNamesMap

func LoadNamesMap(chain string, parts types.Parts, terms []string) (map[base.Address]types.Name, error)

LoadNamesMap loads the names from the cache and returns a map of names

func ReadName

func ReadName(dbType DatabaseType, chain string, address base.Address) (name *types.Name)

func RegularWriteNames

func RegularWriteNames(chain string, dryRun bool) (err error)

func RemoveName

func RemoveName(dbType DatabaseType, chain string, address base.Address) (name *types.Name, err error)

func SetDeleted

func SetDeleted(dbType DatabaseType, chain string, address base.Address, deleted bool) (name *types.Name, err error)

func UpdateName

func UpdateName(dbType DatabaseType, chain string, name *types.Name) (err error)

Types

type DatabaseType

type DatabaseType string
const (
	DatabaseRegular DatabaseType = "names.tab"
	DatabaseCustom  DatabaseType = "names_custom.tab"
	DatabaseDryRun  DatabaseType = "<dryrun>"
)

type NameReader

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

func NewNameReader

func NewNameReader(source io.Reader) (NameReader, error)

func (*NameReader) Read

func (gr *NameReader) Read() (types.Name, error)

type NameWriter

type NameWriter struct {
	WriteHeader bool
	Format      nameWriterFormat
	Header      []string
	// contains filtered or unexported fields
}

func NewNameWriter

func NewNameWriter(destWriter io.Writer) *NameWriter

func (*NameWriter) Error

func (w *NameWriter) Error() error

func (*NameWriter) Flush

func (w *NameWriter) Flush()

func (*NameWriter) Write

func (w *NameWriter) Write(name *types.Name) (err error)

Jump to

Keyboard shortcuts

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