api

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright (c) 2019 the Octant contributors. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0

* Copyright (c) 2019 the Octant contributors. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionDispatcher

type ActionDispatcher interface {
	Dispatch(ctx context.Context, alerter action.Alerter, actionName string, payload action.Payload) error
}

ActionDispatcher dispatches actions.

type ClientManager

type ClientManager interface {
	Run(ctx context.Context)
	Clients() []StreamingClient
	ClientFromRequest(dashConfig config.Dash, w http.ResponseWriter, r *http.Request) (StreamingClient, error)
	TemporaryClientFromLoadingRequest(w http.ResponseWriter, r *http.Request) (StreamingClient, error)
	Get(id string) event.WSEventSender
	Context() context.Context
	ActionDispatcher() ActionDispatcher
}

ClientManager is an interface for managing clients.

type OctantClient

type OctantClient interface {
	Send(event.Event)
	ID() string
	StopCh() <-chan struct{}
}

OctantClient is the interface responsible for sending streaming data to a users session, usually in a browser.

type StateManager

type StateManager interface {
	Handlers() []octant.ClientRequestHandler
	Start(ctx context.Context, state octant.State, s OctantClient)
}

StateManager manages states for WebsocketState.

type StreamRequest

type StreamRequest struct {
	Type    string         `json:"type"`
	Payload action.Payload `json:"payload"`
}

type StreamingClient

type StreamingClient interface {
	OctantClient

	Receive() (StreamRequest, error)

	Handlers() map[string][]octant.ClientRequestHandler
	State() octant.State
}

StreamingClient is the interface responsible for sending and receiving streaming data to a users session, usually in a browser.

type StreamingConnectionManager

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

StreamingConnectionManager is a client manager for streams.

func NewStreamingConnectionManager

func NewStreamingConnectionManager(ctx context.Context, dispatcher ActionDispatcher, clientFactory StreamingClientFactory) *StreamingConnectionManager

NewStreamingConnectionManager creates an instance of WebsocketClientManager.

func (*StreamingConnectionManager) ActionDispatcher

func (m *StreamingConnectionManager) ActionDispatcher() ActionDispatcher

func (*StreamingConnectionManager) ClientFromRequest

func (m *StreamingConnectionManager) ClientFromRequest(dashConfig config.Dash, w http.ResponseWriter, r *http.Request) (StreamingClient, error)

ClientFromRequest creates a websocket client from a http request.

func (*StreamingConnectionManager) Clients

func (*StreamingConnectionManager) Context

func (*StreamingConnectionManager) Get

func (*StreamingConnectionManager) Run

Run runs the manager. It manages multiple websocket clients.

func (*StreamingConnectionManager) TemporaryClientFromLoadingRequest

func (m *StreamingConnectionManager) TemporaryClientFromLoadingRequest(w http.ResponseWriter, r *http.Request) (StreamingClient, error)

Directories

Path Synopsis
Package fake is a generated GoMock package.
Package fake is a generated GoMock package.

Jump to

Keyboard shortcuts

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