api

package
v0.0.0-...-8220f0d Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	RegisterRoutes(router *gin.Engine)
}

Controller is the websocket pub-sub controller

func New

func New(ctx context.Context, pbService pubsub.Server) Controller

func NewWithServiceAndWSUpgrader

func NewWithServiceAndWSUpgrader(ctx context.Context, service Service, upgrader WSUpgrader) Controller

NewWithOptions create a new controller with options

type Error

type Error struct {
	Error string `json:"error"`
}

Error ...

type Service

type Service interface {
	Websocket(string, WriteMessageCloser) (int, error)
	Callback(p internal.Payload)
}

func NewService

func NewService(ctx context.Context, pbService pubsub.Server) Service

type WSUpgrader

type WSUpgrader interface {
	Upgrade(w http.ResponseWriter, r *http.Request) (WriteMessageCloser, error)
}

type WriteMessageCloser

type WriteMessageCloser interface {
	io.Closer
	WriteMessage(int, []byte) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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