websocket

package
v5.7.0-rc2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Subscribe

func Subscribe(apiKey string, accessToken string, baseUrl string, wsClientId string) (*websocket.Conn, error)

Types

type WebsocketClient

type WebsocketClient struct {
	WsConn *websocket.Conn

	Ctx    context.Context    // corresponds to ws session, so ok in struct
	Cancel context.CancelFunc // as above
	// contains filtered or unexported fields
}

func (*WebsocketClient) ReadMessages

func (wsc *WebsocketClient) ReadMessages() (*WorkflowResponse, error)

type WebsocketOptions

type WebsocketOptions struct {
	PingPeriod     time.Duration
	PongWait       time.Duration
	MaxMessageSize int64
	WriteWait      time.Duration
}

WebsocketOptions command line options group that apply to all websockets

type WorkFlowResponseData

type WorkFlowResponseData struct {
	Result       interface{} `json:"result"`
	WorkflowId   string      `json:"workflowId"`
	WorkflowName string      `json:"workflowName"`
	WsClientId   string      `json:"wsClientId"`
}

type WorkflowResponse

type WorkflowResponse struct {
	SpecVersion     string               `json:"specversion"`
	Id              string               `json:"id"`
	Source          string               `json:"source"`
	Type            string               `json:"type"`
	Subject         string               `json:"subject"`
	DataContentType string               `json:"datacontenttype"`
	Time            string               `json:"time"`
	Data            WorkFlowResponseData `json:"data"`
	EventKind       string               `json:"eventkind"`
	EventResource   string               `json:"eventresource"`
	Recipient       string               `json:"recipient"`
	CorrelationId   string               `json:"correlationid"`
	Stream          string               `json:"stream"`
}

func ReadResponse

func ReadResponse(wsConn *websocket.Conn) (*WorkflowResponse, error)

Jump to

Keyboard shortcuts

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