stream

package
v0.0.0-...-3936e01 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Name      string  `json:"name"`
	Timestamp int64   `json:"ts"`
	Val       float64 `json:"val"`
}

func GetData

func GetData() *Data

func (*Data) String

func (d *Data) String() string

type FollowStream

type FollowStream interface {
	Follow(string, *Follower)
	Unfollow(string, *Follower)
}

type Follower

type Follower struct {
	Pub  chan *Data
	Rate int64
}

type Streamer

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

func NewStreamer

func NewStreamer(handler FollowStream) *Streamer

func (*Streamer) Handler

func (s *Streamer) Handler(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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