memxl

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package memxl provides a xlistd.List implementation that uses main memory for storage.

This package is a work in progress and makes no API stability promises.

Index

Constants

View Source
const ComponentClass = "mem"

ComponentClass registered.

Variables

This section is empty.

Functions

func Builder

func Builder(defaultCfg Config) xlistd.BuildListFn

Builder returns a builder function.

func LoadFromData

func LoadFromData(list *List, data []Data, clearBefore bool) error

LoadFromData loads a hashmem list from a data array

func LoadFromFile

func LoadFromFile(list *List, filename string, clearBefore bool) error

LoadFromFile loads a hashmem list from a file content

Types

type Config

type Config struct {
	ForceValidation bool
	Reason          string
}

Config options

type Data

type Data struct {
	Resource xlist.Resource
	Format   xlistd.Format
	Value    string
}

Data is used for bulk insertions

func (Data) String

func (i Data) String() string

type List

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

List stores all items in memory.

func New

func New(id string, resources []xlist.Resource, cfg Config) *List

New returns a new List.

func (*List) AddCIDR4

func (l *List) AddCIDR4(cidr string) error

AddCIDR4 adds CIDR.

func (*List) AddCIDR4s

func (l *List) AddCIDR4s(cidrs []string) error

AddCIDR4s add a list of cidrs.

func (*List) AddCIDR6

func (l *List) AddCIDR6(cidr string) error

AddCIDR6 adds CIDR.

func (*List) AddCIDR6s

func (l *List) AddCIDR6s(cidrs []string) error

AddCIDR6s add a list of cidrs.

func (*List) AddDomain

func (l *List) AddDomain(domain string) error

AddDomain adds domain.

func (*List) AddDomains

func (l *List) AddDomains(domains []string) error

AddDomains add a list of domains.

func (*List) AddIP4

func (l *List) AddIP4(ip string) error

AddIP4 add ip4.

func (*List) AddIP4s

func (l *List) AddIP4s(ips []string) error

AddIP4s add a list of ip4.

func (*List) AddIP6

func (l *List) AddIP6(ip string) error

AddIP6 add ip6.

func (*List) AddIP6s

func (l *List) AddIP6s(ips []string) error

AddIP6s add a list of ip6.

func (*List) AddMD5

func (l *List) AddMD5(hash string) error

AddMD5 add md5 hash.

func (*List) AddMD5s

func (l *List) AddMD5s(hashes []string) error

AddMD5s add a list of md5.

func (*List) AddSHA1

func (l *List) AddSHA1(hash string) error

AddSHA1 add sha1 hash.

func (*List) AddSHA1s

func (l *List) AddSHA1s(hashes []string) error

AddSHA1s add a list of sha1 hashes.

func (*List) AddSHA256

func (l *List) AddSHA256(hash string) error

AddSHA256 add sha256 hash.

func (*List) AddSHA256s

func (l *List) AddSHA256s(hashes []string) error

AddSHA256s add a list of sha256 hashes.

func (*List) AddSubdomain

func (l *List) AddSubdomain(subdomain string) error

AddSubdomain adds a subdomain.

func (*List) AddSubdomains

func (l *List) AddSubdomains(subdomains []string) error

AddSubdomains add a list of subdomains.

func (*List) Append

func (l *List) Append(ctx context.Context, name string, r xlist.Resource, f xlistd.Format) error

Append item.

func (*List) Check

func (l *List) Check(ctx context.Context, name string, resource xlist.Resource) (xlist.Response, error)

Check implements xlist.Checker interface.

func (*List) Class

func (l *List) Class() string

Class implements xlistd.List interface.

func (*List) Clear

func (l *List) Clear() error

Clear list.

func (*List) ID

func (l *List) ID() string

ID implements xlistd.List interface.

func (*List) LoadData

func (l *List) LoadData(ctx context.Context, data []Data) error

LoadData loads list from a data array

func (*List) LoadReader

func (l *List) LoadReader(ctx context.Context, in io.Reader) error

LoadReader data to the list from an io.Reader with the memxl format

func (*List) Ping

func (l *List) Ping() error

Ping implements xlistd.List interface.

func (*List) Remove

func (l *List) Remove(ctx context.Context, name string, r xlist.Resource, f xlistd.Format) error

Remove item.

func (*List) Resources

func (l *List) Resources(ctx context.Context) ([]xlist.Resource, error)

Resources implements xlist.Checker interface.

Jump to

Keyboard shortcuts

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