icjs

package
v0.0.0-...-d83f28c Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2020 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IRCMSG_MAXSIZE  = 512
	IRCMSG_PREFIX   = "PRIVMSG  :" // that's what it should containt
	IRCMSG_CTPREFIX = "<ic>"
	IRCMSG_SUFFIX   = "\r\n"

	IRCMSG_OVERHEAD = len(IRCMSG_PREFIX) + len(IRCMSG_CTPREFIX) + len(IRCMSG_SUFFIX)
)

Variables

View Source
var (
	// Map of handler depending on the type of message
	ACComMessageHandlerMap = map[int]ACComHandler{
		// contains filtered or unexported fields
	}
)

Functions

func HandleACComMsg

func HandleACComMsg(msg []byte) (msgReply []byte, err error)

func HandleCLMsg

func HandleCLMsg(msg []byte) (msgReply []byte, err error)

Handle Control MESSAGES..

func HandleCTMsg

func HandleCTMsg(msg []byte) (msgReply []byte, err error)

Handle Crypto MESSAGES..

func HandleKXMsg

func HandleKXMsg(msg []byte) (msgReply []byte, err error)

Handle KEY Exchange MESSAGES..

func HandlePKMsg

func HandlePKMsg(msg []byte) (msgReply []byte, err error)

Handle PUBLIC KEY MESSAGES..

func HandleQuitMsg

func HandleQuitMsg(msg []byte) (msgReply []byte, err error)

HandleQuitMsg handles QUIT messages

func HandleStdin

func HandleStdin() (err error)

Types

type ACClMessage

type ACClMessage struct {
	Type    int    `json:"type"`
	Channel string `json:"channel"`
	Server  string `json:"server"`
	Blob    string `json:"blob"`
}

func (*ACClMessage) HandlerCLIAC

func (cl *ACClMessage) HandlerCLIAC() (msgReply []byte, err error)

func (*ACClMessage) HandlerCLLOAD

func (cl *ACClMessage) HandlerCLLOAD() (msgReply []byte, err error)

func (*ACClMessage) HandlerCLSAVE

func (cl *ACClMessage) HandlerCLSAVE() (msgReply []byte, err error)

type ACClReply

type ACClReply struct {
	Type  int    `json:"type"`
	Bada  bool   `json:"bada"`
	Errno int    `json:"errno"`
	Blob  string `json:"blob,omitempty"`
}

type ACComHandler

type ACComHandler func([]byte) ([]byte, error)

ACComHandler defining a communication handler function prototype that are used for handling message types.

type ACComMessage

type ACComMessage struct {
	Type    int    `json:"type"`
	Payload []byte `json:"payload"`
}

ACComMessage is the struct type defining the enveloppe of a JSON message.. Type define the type of message. Payload the content of that message.

func (*ACComMessage) Validate

func (ac *ACComMessage) Validate() (ACComHandler, error)

type ACCtMessage

type ACCtMessage struct {
	Type    int    `json:"type"`
	Nick    string `json:"nick"`
	Server  string `json:"server"`
	Channel string `json:"channel"`
	Blob    string `json:"blob"`
	Opt     string `json:"opt"`
}

func (*ACCtMessage) HandlerCTADD

func (ct *ACCtMessage) HandlerCTADD() (msgReply []byte, err error)

func (*ACCtMessage) HandlerCTOPEN

func (ct *ACCtMessage) HandlerCTOPEN() (msgReply []byte, err error)

func (*ACCtMessage) HandlerCTSEAL

func (ct *ACCtMessage) HandlerCTSEAL() (msgReply []byte, err error)

type ACCtReply

type ACCtReply struct {
	Type   int      `json:"type"`
	Bada   bool     `json:"bada"`
	Errno  int      `json:"errno"`
	Blob   string   `json:"blob"`
	Barray []string `json:"blobarray,omitempty"`
	Nonce  uint32   `json:"nonce"`
}

type ACKxMessage

type ACKxMessage struct {
	Type     int    `json:"type"`
	MyNick   string `json:"me"`
	PeerNick string `json:"peer"`
	Server   string `json:"server"`
	Channel  string `json:"channel"`
	Blob     string `json:"blob"`
}

func (*ACKxMessage) HandlerKXPACK

func (kx *ACKxMessage) HandlerKXPACK() (msgReply []byte, err error)

func (*ACKxMessage) HandlerKXUNPACK

func (kx *ACKxMessage) HandlerKXUNPACK() (msgReply []byte, err error)

type ACKxReply

type ACKxReply struct {
	Type  int  `json:"type"`
	Bada  bool `json:"bada"`
	Errno int  `json:"errno"`
	//Blob  []byte `json:"blob"`
	Blob  string `json:"blob"`
	Nonce uint32 `json:"nonce"`
}

type ACPkMessage

type ACPkMessage struct {
	Type   int    `json:"type"`
	Nick   string `json:"nick"`
	Host   string `json:"host"`
	Server string `json:"server"`
	Blob   string `json:"blob"` // do we really need to []byte that... it's base64 string anyway..

}

func (*ACPkMessage) HandlerPKADD

func (pk *ACPkMessage) HandlerPKADD() (msgReply []byte, err error)

HandlerPKADD is the final handler for PKADD control messages

func (*ACPkMessage) HandlerPKDEL

func (pk *ACPkMessage) HandlerPKDEL() (msgReply []byte, err error)

func (*ACPkMessage) HandlerPKGEN

func (pk *ACPkMessage) HandlerPKGEN() (msgReply []byte, err error)

func (*ACPkMessage) HandlerPKLIST

func (pk *ACPkMessage) HandlerPKLIST() (msgReply []byte, err error)

type ACPkReply

type ACPkReply struct {
	Type  int    `json:"type"`
	Bada  bool   `json:"bada"`
	Errno int    `json:"errno"`
	Blob  string `json:"blob"`
}

Jump to

Keyboard shortcuts

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