service

package
v0.0.0-...-fccee52 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPC

type IPC struct {
	Type  string          `json:"type"`
	Query string          `json:"query,omitempty"`
	ID    string          `json:"id,omitempty"`
	Data  json.RawMessage `json:"data"`
}

type Port

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

func (Port) Close

func (p Port) Close()

func (*Port) PostMessage

func (p *Port) PostMessage(obj IPC)

type Query

type Query struct {
	Port *Port
	ID   string
	Data json.RawMessage
}

func (*Query) Send

func (q *Query) Send(v interface{})

type Service

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

func New

func New() *Service

func (*Service) Broadcast

func (svc *Service) Broadcast(jso interface{})

func (*Service) On

func (svc *Service) On(query string, fn func(q *Query))

func (*Service) OnPort

func (s *Service) OnPort(fn func(p *Port))

func (*Service) Run

func (s *Service) Run()

Jump to

Keyboard shortcuts

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