stream

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DOauth  = "data:subscribe_oauth"
	DHello  = "control:hello"
	DUpdate = "data:update"
	DError  = "data:error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	MsgType   string `json:"msg_type,omitempty"`
	Token     string `json:"token,omitempty"`
	Value     string `json:"value,omitempty"`
	Tag       string `json:"tag,omitempty"`
	ErrorType string `json:"error_type,omitempty"`
}

type StreamingError

type StreamingError struct {
	Msg Message
}

func (StreamingError) Error

func (e StreamingError) Error() string

type Subscriber

type Subscriber struct {
	Data  chan interface{}
	Error chan error
	Close chan struct{}
}

Subscriber 订阅者包含一个接收消息的通道

func StartStream

func StartStream(token string, vehicleId int64) *Subscriber

Jump to

Keyboard shortcuts

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