Categorygithub.com/pusuengine/gopusu
modulepackage
1.0.0
Repository: https://github.com/pusuengine/gopusu.git
Documentation: pkg.go.dev

# README

PuSu Engine client for Golang

This is a client for the PuSu Engine written in Go. PuSu Engine is a Pub-Sub engine.

More information on the server repository at https://github.com/PuSuEngine/pusud.

Get it by running

go get github.com/PuSuEngine/gopusu

Usage

Examples are under tests/. Running the tests will require screen or multiple terminal windows.

One terminal window, running a listener;

cd tests
go run listener.go

Running basic test:

cd tests
go run basic.go

Running throughput:

cd tests
go run throughput.go

Short example how to connect to PuSu server:

package main

import "github.com/PuSuEngine/gopusu"

func main() {
    pc, _ := gopusu.NewPuSuClient("127.0.0.1", 55000)
    defer pc.Close()
    pc.Authorize("foo")
    pc.Subscribe("channel.1", listener)
    pc.Publish("channel.2", "message")
}

func listener(msg *gopusu.Publish) {
	// ...
}

License

Short version: MIT + New BSD.

Long version: Read the LICENSE.md -file.

# Packages

No description provided by the author

# Functions

Create a new PuSu client and connect to the given server.

# Variables

Timeout exceeded when waiting to acknowledge Authorize/Subscribe request.

# Structs

The PuSu client.
Published message from the PuSu network.

# Type aliases

Callback to call with the published messages in a channel we're subscribed to.