Documentation
¶
Index ¶
- type Client
- func (c *Client) Callsign() string
- func (c *Client) Close()
- func (c *Client) Connect() error
- func (c *Client) Filter() string
- func (c *Client) GetStats() Stats
- func (c *Client) Host() string
- func (c *Client) Mode() Mode
- func (c *Client) Port() int
- func (c *Client) Protocol() Protocol
- func (c *Client) ResetStats()
- func (c *Client) SendPacket(packet string) error
- func (c *Client) Server() string
- func (c *Client) Up() bool
- func (c *Client) Uptime() time.Time
- func (c *Client) Wait()
- type Mode
- type Option
- type Protocol
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a basic struct of Client object
func NewClient ¶
func NewClient( callsign string, passcode string, mode Mode, protocol Protocol, host string, port int, options ...Option, ) *Client
NewClient creates a new APRS client
func (*Client) SendPacket ¶
SendPacket sends an APRS packet
type Option ¶
type Option func(*Client)
Option provides a basic option type
func WithBufSize ¶ added in v1.2.4
WithBufSize sets a custom buf size for reader
func WithHandler ¶
WithHandler sets default packet handler to custom
func WithLogger ¶
WithLogger sets default logger to custom
func WithRetryTimes ¶
WithRetryTimes sets a retry times to custom
func WithSoftwareAndVersion ¶
WithSoftwareAndVersion sets default software name and version to custom
type Stats ¶
type Stats struct {
TotalSentBytes uint64 `json:"totalSentBytes"`
TotalRecvBytes uint64 `json:"totalRecvBytes"`
CurrentSentRate uint64 `json:"currentSentRate"`
CurrentRecvRate uint64 `json:"currentRecvRate"`
PacketsSent uint64 `json:"packetsSent"`
PacketsReceived uint64 `json:"packetsReceived"`
ConnectionTime time.Duration `json:"connectionTime"`
LastActivity time.Time `json:"lastActivity"`
}
Stats contains statistics for the client
Click to show internal directories.
Click to hide internal directories.