messagebus

package
v0.0.0-...-3b037d6 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GPSLocationChannel = "msg.gpslocation"
	AddressChannel     = "msg.address"
	UserChannel        = "msg.user"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Home string
}

type Cord

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

func New

func New(addr []string) *Cord

func NewWithGrouping

func NewWithGrouping(addr []string) *Cord

func (*Cord) Close

func (c *Cord) Close() (err error)

func (*Cord) Connect

func (c *Cord) Connect(ctx context.Context) error

func (*Cord) RecvAddress

func (c *Cord) RecvAddress(ctx context.Context, handler func(a Address) error)

func (*Cord) RecvGPSLocation

func (c *Cord) RecvGPSLocation(ctx context.Context, handler func(loc GPSLocation) error)

func (*Cord) RecvUser

func (c *Cord) RecvUser(ctx context.Context, handler func(u User) error)

func (*Cord) SendAddress

func (c *Cord) SendAddress(ctx context.Context, a Address) error

func (*Cord) SendGPSLocation

func (c *Cord) SendGPSLocation(ctx context.Context, loc GPSLocation) error

func (*Cord) SendUser

func (c *Cord) SendUser(ctx context.Context, u User) error

type GPSLocation

type GPSLocation struct {
	Lat float32
	Lng float32
}

type User

type User struct {
	Name string
}

Jump to

Keyboard shortcuts

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