hub

package
v0.0.0-...-a4452f2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 24 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ElectionStatus

type ElectionStatus struct {
	IsMaster bool
}

ElectionStatus describes the status of an election

type Hub

type Hub struct {
	Graph *graph.Graph
	// contains filtered or unexported fields
}

Hub describes a graph hub that accepts incoming connections from pods, other hubs, subscribers or external publishers

func NewHub

func NewHub(id string, serviceType service.Type, listen string, g *graph.Graph, cached *graph.CachedBackend, podEndpoint string, opts Opts) (*Hub, error)

NewHub returns a new hub

func (*Hub) APIServer

func (h *Hub) APIServer() *api.Server

APIServer returns the hub API server

func (*Hub) GetStatus

func (h *Hub) GetStatus() interface{}

GetStatus returns the status of a hub

func (*Hub) GremlinTraversalParser

func (h *Hub) GremlinTraversalParser() *traversal.GremlinTraversalParser

GremlinTraversalParser returns the hub Gremlin traversal parser

func (*Hub) HTTPServer

func (h *Hub) HTTPServer() *shttp.Server

HTTPServer returns the hub HTTP server

func (*Hub) OnPong

func (h *Hub) OnPong(speaker websocket.Speaker)

OnPong handles pong messages and store the last pong timestamp in etcd

func (*Hub) OnStarted

func (h *Hub) OnStarted()

OnStarted - Persistent backend listener

func (*Hub) PodServer

func (h *Hub) PodServer() *websocket.StructServer

PodServer returns the websocket server dedicated to pods

func (*Hub) Start

func (h *Hub) Start() error

Start the hub

func (*Hub) Stop

func (h *Hub) Stop()

Stop the hub

func (*Hub) SubscriberServer

func (h *Hub) SubscriberServer() *websocket.StructServer

SubscriberServer returns the websocket server dedicated to subscribers

type Opts

type Opts struct {
	Hostname            string
	Version             string
	ClusterName         string
	WebsocketOpts       websocket.ServerOpts
	WebsocketClientOpts websocket.ClientOpts
	APIValidator        api.Validator
	GraphValidator      schema.Validator
	TopologyMarshallers api.TopologyMarshallers
	StatusReporter      api.StatusReporter
	APIAuthBackend      shttp.AuthenticationBackend
	ClusterAuthBackend  shttp.AuthenticationBackend
	ReplicationPeers    []service.Address
	ClusterPeers        map[string]*PeeringOpts
	TLSConfig           *tls.Config
	EtcdClient          *etcdclient.Client
	EtcdServerOpts      *etcdserver.EmbeddedServerOpts
	Logger              logging.Logger
	Assets              assets.Assets
}

Opts Hub options

type PeeredClustersStatus

type PeeredClustersStatus struct {
	Election ElectionStatus
	Outgoers []websocket.ConnStatus
}

PeeredClustersStatus describes the state of peering with an other cluster

type PeeringOpts

type PeeringOpts struct {
	Endpoints           []service.Address
	WebsocketClientOpts websocket.ClientOpts
	PublisherFilter     string
	SubscriptionFilter  string
}

type PeersStatus

type PeersStatus struct {
	Incomers map[string]websocket.ConnStatus
	Outgoers map[string]websocket.ConnStatus
}

PeersStatus describes the state of a peer

type Status

type Status struct {
	Alerts         ElectionStatus
	Pods           map[string]websocket.ConnStatus
	Peers          PeersStatus
	Publishers     map[string]websocket.ConnStatus
	Subscribers    map[string]websocket.ConnStatus
	PeeredClusters map[string]PeeredClustersStatus
}

Status describes the status of a hub

Jump to

Keyboard shortcuts

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