userdb

package module
v1.0.29 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: LGPL-3.0 Imports: 14 Imported by: 3

README

Library for building userdb files for MD-380/MD-UV380 radios.

This library provides a go API for building MD-380 (and other DMR radios) userdb files.

Author

Dale Farnsworth

dale@farnsworth.org

IRC: libera.chat channel: #md380, user: dfarnsworth

Documentation

Index

Constants

View Source
const (
	MinProgress = 0
	MaxProgress = 1000000
)

Minimum and maximum vallues of the progress counter

View Source
const (
	MaxUV380Users = 122197
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DBOption added in v1.0.26

type DBOption func(db *UsersDB)

func Abbreviate added in v1.0.26

func Abbreviate(b bool) DBOption

func AbbreviateCountries added in v1.0.26

func AbbreviateCountries(b bool) DBOption

func AbbreviateDirections added in v1.0.26

func AbbreviateDirections(b bool) DBOption

func AbbreviateStates added in v1.0.26

func AbbreviateStates(b bool) DBOption

func CheckTitleCase added in v1.0.26

func CheckTitleCase(b bool) DBOption

func CuratedUsers added in v1.0.26

func CuratedUsers() DBOption

func FilterByCountries added in v1.0.26

func FilterByCountries(countries ...string) DBOption

func FixRomanNumerals added in v1.0.26

func FixRomanNumerals(b bool) DBOption

func FixStateCountries added in v1.0.26

func FixStateCountries(b bool) DBOption

func FromFile added in v1.0.26

func FromFile(path string) DBOption

func MergeNewUsers added in v1.0.26

func MergeNewUsers() DBOption

func MiscFixes added in v1.0.26

func MiscFixes(b bool) DBOption

func RemoveCallFromNickname added in v1.0.26

func RemoveCallFromNickname(b bool) DBOption

func RemoveMatchingNickname added in v1.0.26

func RemoveMatchingNickname(b bool) DBOption

func RemoveRepeatedSurnames added in v1.0.26

func RemoveRepeatedSurnames(b bool) DBOption

func RemoveRepeats added in v1.0.26

func RemoveRepeats(b bool) DBOption

func TitleCase added in v1.0.26

func TitleCase(b bool) DBOption

type RadioidTop

type RadioidTop struct {
	RadioidUsers []*RadioidUser `json:"users"`
}

type RadioidUser

type RadioidUser struct {
	ID       int    `json:"radio_id"`
	Callsign string `json:"callsign"`
	Name     string `json:"name"`
	Surname  string `json:"surname"`
	City     string `json:"city"`
	State    string `json:"state"`
	Country  string `json:"country"`
}

type User

type User struct {
	ID       int
	Callsign string
	Name     string
	City     string
	State    string
	Nickname string
	Country  string
	// contains filtered or unexported fields
}

User - A structure holding information about a user in the databae

type UsersDB

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

UsersDB - A structure holding information about the database of DMR users

func New

func New(opts ...DBOption) (*UsersDB, error)

New Users DB - Instantiate a new users db and (by default) download curated users

func (*UsersDB) AllCountries added in v1.0.18

func (db *UsersDB) AllCountries() ([]string, error)

func (*UsersDB) MD380String added in v1.0.18

func (db *UsersDB) MD380String() string

func (*UsersDB) SetOptions

func (db *UsersDB) SetOptions(opts ...DBOption)

func (*UsersDB) SetProgressCallback

func (db *UsersDB) SetProgressCallback(fcn func(int) error)

SetProgressCallback - Set callback function for progress of db operations.

func (*UsersDB) UV380Image added in v1.0.18

func (db *UsersDB) UV380Image() []byte

func (*UsersDB) Users

func (db *UsersDB) Users() []*User

Users - Return the, possibly filtered, current list of DMR users

func (*UsersDB) WriteMD380ToolsFile

func (db *UsersDB) WriteMD380ToolsFile(filename string) error

WriteMD380ToolsFile - Write a user db file in MD380 format

Jump to

Keyboard shortcuts

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