websocket

package
v0.0.0-...-a32039b Latest Latest
Warning

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

Go to latest
Published: May 22, 2016 License: MIT Imports: 4 Imported by: 3

Documentation

Overview

Package websocket implements the websocket protocol according to RFC 6455. Websockets are used to send updates for all events through the notifications package.

Package websocket implements the websocket protocol according to RFC 6455. Websockets are used to send updates for all events through the notifications package.

Package websocket implements the websocket protocol according to RFC 6455. Websockets are used to send updates for all events through the notifications package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHandler

func GetHandler() websocket.Handler

GetHandler returns a net/http.Handler compatible handler for websockets.

func NewClient

func NewClient(ws *websocket.Conn) *client

NewClient returns a new websocket client.

func NewServer

func NewServer()

NewServer initializes a new websocket server.

func Send

func Send(msg *Message)

Send sends a message to all connected clients.

Types

type Message

type Message struct {
	Name           string `json:"name"`
	Email          string `json:"email"`
	Event          string `json:"event"`
	RepositoryName string `json:"repository_name"`
	Branch         string `json:"branch"`
	Status         string `json:"status"`
	URL            string `json:"url"`
}

Message contains all fields consumed by differetn websockets to render different events.

func NewMessage

func NewMessage(job *database.Job, event string) *Message

NewMessage converts a job and event type to a message that can be send through a websocket.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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