gobench

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package gobench implements alternative controller for benchmarking Go server w/o RPC. Mimics BenchmarkChannel from https://github.com/palkan/websocket-shootout/blob/master/ruby/action-cable-server/app/channels/benchmark_channel.rb

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BroadcastMessage

type BroadcastMessage struct {
	Stream string `json:"stream"`
	Data   string `json:"data"`
}

BroadcastMessage represents a pubsub payload

type Controller

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

Controller implements node.Controller interface for gRPC

func NewController

func NewController(config *config.Config, metrics *metrics.Metrics) *Controller

NewController builds new Controller from config

func (*Controller) Authenticate

func (c *Controller) Authenticate(sid string, path string, headers *map[string]string) (string, []string, error)

Authenticate allows everyone to connect and returns welcome message and rendom ID as identifier

func (*Controller) Disconnect

func (c *Controller) Disconnect(sid string, id string, subscriptions []string, path string, headers *map[string]string) error

Disconnect performs disconnect RPC call

func (*Controller) Perform

func (c *Controller) Perform(sid string, id string, channel string, data string) (res *node.CommandResult, err error)

Perform performs Command RPC call with "perform" command

func (*Controller) Shutdown

func (c *Controller) Shutdown() error

Shutdown is no-op

func (*Controller) Start

func (c *Controller) Start() error

Start is no-op

func (*Controller) Subscribe

func (c *Controller) Subscribe(sid string, id string, channel string) (*node.CommandResult, error)

Subscribe performs Command RPC call with "subscribe" command

func (*Controller) Unsubscribe

func (c *Controller) Unsubscribe(sid string, id string, channel string) (*node.CommandResult, error)

Unsubscribe performs Command RPC call with "unsubscribe" command

type Identifiers

type Identifiers struct {
	ID string `json:"id"`
}

Identifiers represents a connection identifiers

Jump to

Keyboard shortcuts

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