nyb

package
v0.0.0-...-58f2574 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Zones []byte

Zones contains time zone information in JSON format

Functions

This section is empty.

Types

type Channels

type Channels []string

Channels is a flag that parses a list of IRC channels

func (*Channels) Set

func (i *Channels) Set(value string) error

Set satisfies the flag Interface

func (*Channels) String

func (i *Channels) String() string

type Country

type Country struct {
	Name   string   `json:"name"`
	Cities []string `json:"cities"`
}

type NominatimResult

type NominatimResult struct {
	Lat         float64
	Lon         float64
	DisplayName string `json:"Display_name"`
}

NominatimResult ...

func (*NominatimResult) UnmarshalJSON

func (n *NominatimResult) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON ...

type NominatimResults

type NominatimResults []NominatimResult

NominatimResults ...

func NominatimFetcher

func NominatimFetcher(email, server, query string) (res NominatimResults, err error)

func NominatimFetcherLong

func NominatimFetcherLong(email, server, country, city, query string) (res NominatimResults, err error)

NominatimFetcher makes Nominatim API request

type Settings

type Settings struct {
	Nick      string
	Channels  []string
	Server    string
	SSL       bool
	Password  string
	Prefix    string
	Email     string
	Nominatim string
	Limit     bool
	Colors    bool
	// contains filtered or unexported fields
}

Settings for the bot

func New

func New(s *Settings) *Settings

New creates a new bot

func (*Settings) LogLvl

func (bot *Settings) LogLvl(Lvl log.Lvl)

LogLvl sets the log level

func (*Settings) Start

func (bot *Settings) Start()

Start starts the bot

type TZ

type TZ struct {
	Countries []Country `json:"countries"`
	Offset    float64   `json:"offset"`
}

TZ holds time zone data

func (TZ) Format

func (t TZ) Format(max int, color bool) (x string)

func (TZ) String

func (t TZ) String() (x string)

type TZS

type TZS []TZ

TZS is a slice of timezones

func (TZS) Exists

func (t TZS) Exists(offset float64, country, city string) bool

func (TZS) Insert

func (t TZS) Insert(offset float64, country, city string) TZS

func (TZS) Len

func (t TZS) Len() int

func (TZS) Less

func (t TZS) Less(i, j int) bool

func (TZS) Swap

func (t TZS) Swap(i, j int)

type Timer

type Timer struct {
	C      chan bool
	Target time.Time
	// contains filtered or unexported fields
}

Timer struct

func NewTimer

func NewTimer(dur time.Duration) *Timer

NewTimer returns a ticker based timer. We need this to take into account time taken in suspend, hibernation or if system time is changed.

func (*Timer) Stop

func (t *Timer) Stop()

Stop stops the timer

Jump to

Keyboard shortcuts

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