natscliws

package module
v0.0.0-...-bdd0b83 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

README

go-nats-cli-ws

Go nats.io client via websockets proxy

package main

import (
    mqs "github.com/9glt/go-stan-cli-ws"
    stan "github.com/nats-io/stan.go"
)

func main() {
    conn, err := mqs.New("wss://host.domain.tld/path?token=tok", "nats://user:pass@127.0.0.1:4222", "test-cluster", "client-1")
    if err != nil {
        panic(err)
    }
    
    sc := conn.UnderlyingConn()

    // use sc 
    
    // ...
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MQ

type MQ struct {
	// contains filtered or unexported fields
}

func New

func New(ws, n, cluster, client string) (*MQ, error)

New connects to nats via websocket dialer

func (*MQ) UnderlyingConn

func (mq *MQ) UnderlyingConn() stan.Conn

Jump to

Keyboard shortcuts

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