ftnlib

package
v0.0.0-...-e95e56c Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsString

func ContainsString(needle string, haystack []string) bool

ContainsString - method to define is string value in array

func CountSQLResultRows

func CountSQLResultRows(rows *sql.Rows) (cnt int)

CountSQLResultRows - count the sql rows

func DropNodelistIndex

func DropNodelistIndex(DBPath string) (res bool, err error)

DropNodelistIndex - Delete index from db

func GetStorage

func GetStorage(path string, store string) (db *sql.DB, err error)

GetStorage - returns db for querying

func InitApp

func InitApp() (app cli.App, err error)

InitApp - Creates all needed environment variables

func NodeInfo

func NodeInfo(DBPath string) (err error)

NodeInfo - Get full node info by 3D-address

func SearchNodelist

func SearchNodelist(DBPath string) (err error)

SearchNodelist - Search for records in nodelist

Types

type Address

type Address interface {
	Dump2D() (addressDump string)
	Dump3D() (addressDump string)
	Dump5D() (addressDump string)
}

Address - address operations interface

type FtnAddress

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

FtnAddress - address object structure

func FormFtnAddress

func FormFtnAddress(zone int, region int, net int, node int, point int, domain string) (address FtnAddress, err error)

FormFtnAddress - ints to address

func ParseFtnAddress

func ParseFtnAddress(addr string) (address FtnAddress, err error)

ParseFtnAddress - parse ftn-address string to object FtnAddress

func (*FtnAddress) Dump2D

func (address *FtnAddress) Dump2D() (addressDump string)

Dump2D - returns z:n, string

func (*FtnAddress) Dump3D

func (address *FtnAddress) Dump3D() (addressDump string)

Dump3D - returns z:n/f(.p), string

func (*FtnAddress) Dump5D

func (address *FtnAddress) Dump5D() (addressDump string)

Dump5D - returns z:n/f.p@domain, string

func (*FtnAddress) GetType

func (address *FtnAddress) GetType() (addressType string, special bool)

GetType - returns type of parsed address (string) and special flag (bool)

func (*FtnAddress) Special

func (address *FtnAddress) Special() (res bool)

Special - returns special flag, bool

func (*FtnAddress) Type

func (address *FtnAddress) Type() (res string)

Type - returns address type, string

type FtnPacket

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

FtnPacket - Anarchived fts-0001 packet

type Nodelist

type Nodelist struct {
	List []nodelistHost
}

Nodelist - a list of parsed nodelist lines

func ParseNodelist

func ParseNodelist(nflPath string) (nl Nodelist, err error)

ParseNodelist - the main function

func (*Nodelist) UpdateIndex

func (nodeList *Nodelist) UpdateIndex(DBPath string) (res bool, err error)

UpdateIndex - Check nodelist and update nodelist address book This operaton can take a time to run

Jump to

Keyboard shortcuts

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