🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

suah.dev/icb

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

suah.dev/icb

Go Modules
Version
v0.1.0
Version published
Created
Source
package icb // import "suah.dev/icb"


FUNCTIONS

func DefaultHandlers() map[string]interface{}
    DefaultHandlers produces a set of handlers that will print messages to
    stdout. Ping ("l") packets will also be Pong'd ("m") if received.


TYPES

type Client struct {
	Conn     net.Conn
	Handlers map[string]interface{}
}
    Client gives us a convenient way to Read and Write ICB packets to a remote
    server.

func (c *Client) Connect(s string) (err error)
    Connect connects to specified ICB server.

func (c *Client) Read() (*Packet, error)
    Read reads the next packet from the server. The first byte contains the
    length of the packet to be read.

func (c *Client) RunHandlers(s []string) error
    RunHandlers iterates over each handler and executes on the corresponding
    packet type. If the packet is unhandled, we return an error containing the
    packet type.

func (c *Client) Write(s []string) error
    Write writes a packet to an ICB server

type Packet struct {
	Buffer bytes.Buffer
}
    Packet represents a packet as described by
    https://www.icb.net/_jrudd/protocol.html

func (p *Packet) Decode() (*[]string, error)
    Decode reads from the buffer and decodes the packet.

func (p *Packet) Encode(params []string) error
    Encode writes an ICB formatted packet to the Buffer.

func (p *Packet) Send(c net.Conn) error
    Send takes a connection and sends the ICB packet over it.

FAQs

Package last updated on 25 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts