pubsub

package
v0.0.0-...-d0bd67e Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package pubsub is used for twitch's pubsub. This implementation is not tested at all.

Index

Constants

View Source
const AppName string = "goPurple/pubsub"

AppName is the name of the application

FullVersion contains the full name and version of this package in a printable string

View Source
const VersionBuild string = "d"

VersionBuild is the type of this release. s(table), b(eta), d(evelopment), n(ightly)

View Source
const VersionMajor string = "0"

VersionMajor 0 means in development, >1 ensures compatibility with each minor version, but breakes with new major version

View Source
const VersionMinor string = "1"

VersionMinor introduces changes that require a new version number. If the major version is 0, they are likely to break compatibility

Variables

View Source
var ArchiumDataIdentifier = "Message"

ArchiumDataIdentifier which contains the actual payload

View Source
var ArchiumPrefix = "twitch.pubsub."

ArchiumPrefix for twitch pubsub messages

Functions

This section is empty.

Types

type PsResult

type PsResult struct {
	Type  string `json:"type"`
	Nonce string `json:"nonce"`
	Error string `json:"error"`
	Data  struct {
		Topic      string                 `json:"topic"`
		RawMessage string                 `json:"message"`
		Message    map[string]interface{} `json:"-"`
	} `json:"data"`
}

PsResult is the message sent by pubsub

type Pubsub

type Pubsub struct {
	URL string
	// contains filtered or unexported fields
}

Pubsub is a simple container for the pubsub

func (*Pubsub) Close

func (ps *Pubsub) Close()

Close closes the connection

func (*Pubsub) Connect

func (ps *Pubsub) Connect()

Connect connects to a pubsub

func (*Pubsub) Listen

func (ps *Pubsub) Listen(topics []string, token string)

Listen subscribes to a list of topics

func (*Pubsub) Recv

func (ps *Pubsub) Recv()

Recv waits for incoming messages

Jump to

Keyboard shortcuts

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