socket

package
v0.0.0-...-9caf962 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2014 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

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

Types

type Message

type Message struct {
	Action string

	// "new", "set", "destroy", "save", "load", "setDisplay"
	Name string `json:",omitempty"`

	// "new"
	Kind string `json:",omitempty"`

	// "new", "set"
	Value float64 `json:",omitempty"` // for Kind: "value"

	// "connect", "disconnect"
	From  string `json:",omitEmpty"`
	To    string `json:",omitempty"`
	Input string `json:",omitempty"`

	// "setDisplay"
	Display map[string]interface{} `json:",omitempty"`

	// "hello"
	KindInputs map[string][]string `json:",omitempty"`

	// "setGraph"
	Graph []*ui.Object `json:",omitempty"`

	// "message"
	Message string
}

type Session

type Session struct {
	M <-chan *Message
	// contains filtered or unexported fields
}

func NewSession

func NewSession() (*Session, error)

func (*Session) Close

func (s *Session) Close() error

func (*Session) Handle

func (s *Session) Handle(m *Message) (err error)

func (*Session) Hello

func (s *Session) Hello(kindInputs map[string][]string)

func (*Session) SetGraph

func (s *Session) SetGraph(graph []*ui.Object)

Jump to

Keyboard shortcuts

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