dmrtools

package module
v0.0.0-...-6396c93 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

README

dmrtools

Golang version of Python dmr_utils

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRptrFile

func CheckRptrFile(rptrFile string, rptrURL string)

CheckRptrFile checks to see if the repeater file is present, and if not then downloads it. If the file is present, then check the age. If the file is over 7 days old, redownload it.

func CheckUserFile

func CheckUserFile(userFile string, userURL string)

CheckUserFile checks to see if the user file is present, and if not then downloads it. If the file is present, then check the age. If the file is over 7 days old, redownload it.

func GetAliasShort

func GetAliasShort(userFile string, userID string) string

GetAliasShort returns a user's callsign and name. Needs to be cleaned up, for sure. Probably would do better with a variadic function but this is my first attempt at it. It works for now.

func GetAliasString

func GetAliasString(userFile string, userID string) string

GetAliasString returns a full alias string for a given user ID. Needs to be cleaned up, for sure. Probably would do better with a variadic function but this is my first attempt at it. It works for now.

func GetRepeaterCall

func GetRepeaterCall(rptrFile string, rptID string) string

GetRepeaterCall reads the rptr call file and returns the callsign of the ID that was queried.

func GetUserCall

func GetUserCall(userFile string, userID string) string

GetUserCall reads the user call file and returns the callsign of the ID that was queried.

Types

type WriteCounter

type WriteCounter struct {
	Total uint64
}

WriteCounter counts the number of bytes written to it. It implements to the io.Writer interface and we can pass this into io.TeeReader() which will report progress on each write cycle.

func (WriteCounter) PrintProgress

func (wc WriteCounter) PrintProgress()

PrintProgress does what it says on the tin. It.. well, it prints the progress.

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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