Categorygithub.com/coalalib/coalago
modulepackage
1.0.6
Repository: https://github.com/coalalib/coalago.git
Documentation: pkg.go.dev

# README

Coala

Coala is a Go-Lang library for secure peer-to-peer communication based on Constrained Application Protocol (CoAP, see RFC#7252).

COAP diff:

  • curve cripto
  • arq fast data transmission (30MBit./s) + OptionSelectiveRepeatWindowSize option

Installation

go get -u github.com/coalalib/coalago

Usage

Basic

coala := Coala.NewCoala()

Simple server & Simple client

package main

import (
	"fmt"
	"net"
	"github.com/coalalib/coalago"
	"github.com/coalalib/coalago/resource" 
)

func main() {
	server()
	client()
}

func server() {
	coalaServer := coalago.NewListen(5683)

	coalaServer.GET("/parrot", func(message   *CoAPMessage) *resource.CoAPResourceHandlerResult {
		word := message.GetURIQuery("word")
		handlerResult := resource.NewResponse( NewStringPayload(word), CoapCodeContent)
		return handlerResult
	})
}

func client() {
	coalaClient := coalago.NewCoala()
	requestMessage := NewCoAPMessage( CON, GET)
	requestMessage.SetURIPath("/parrot")
	requestMessage.SetURIQuery("word", "hello world!")

	address, err := net.ResolveUDPAddr("udp", "127.0.0.1:5683")
	if err != nil {
		fmt.Println(err)
		return
	}

	responseMessage, err := coalaClient.Send(requestMessage, address)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println("RESPONSE: ", responseMessage.Payload.String())
}

Encrypted Messaging

Coala is designed to be strongly secured, simple and lightweight and the same time.

Switching between standard and secured connections is easy as is, just specify "coaps" scheme in your request:

request := coalago.NewCoAPMessage(coalago.CON, coalago.GET)
requestMessage.SetSchemeCOAPS()
request.SetStringPayload("Put your innermost secrets here... And nobody will be able to read it...")

# Packages

No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
Converts an array of bytes to a Mesasge object.
No description provided by the author
Represents a message payload containing an array of bytes.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Instantiates a New Option.
No description provided by the author
No description provided by the author
No description provided by the author
Instantiates a new message payload of type string.
No description provided by the author
No description provided by the author
Converts a message object to a byte array.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Errors.
No description provided by the author
No description provided by the author
No description provided by the author
(2.31 Continue).
No description provided by the author
No description provided by the author
Response.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
(4.08).
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Fragments/parts of a CoAP Message packet.
Fragments/parts of a CoAP Message packet.
Fragments/parts of a CoAP Message packet.
Fragments/parts of a CoAP Message packet.
Fragments/parts of a CoAP Message packet.
No description provided by the author
No description provided by the author
methods.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Handshake option is used by Coala library to detect handshake CoAP messages.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Session expired option indicates that peer's coaps:// session expired Upon receiving the message with this option sender must restart the session.
Session Not Found option indicates to sender that peer has no active coaps:// session.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
URI scheme options specifies scheme to be used for message transmission See `CoAPMessage.GetScheme()`.
No description provided by the author
No description provided by the author
POST
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
go:generate bash ./version.sh.

# Structs

No description provided by the author
No description provided by the author
A Message object represents a CoAP payload.
Represents an Option for a CoAP Message.
No description provided by the author
No description provided by the author
Represents an empty message payload.
Represents a message payload containing JSON String.
No description provided by the author
No description provided by the author
Represents a message payload containing string value.
Represents a message payload containing XML String.

# Interfaces

Represents the payload/content of a CoAP Message.
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author