net

package
v0.0.0-...-a87ccbc Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: MIT Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	DestinationId string
	// contains filtered or unexported fields
}

func NewChannel

func NewChannel(conn *Connection, sourceId, destinationId, namespace string) *Channel

func (*Channel) Message

func (c *Channel) Message(message *api.CastMessage, headers *PayloadHeaders)

func (*Channel) OnMessage

func (c *Channel) OnMessage(responseType string, cb func(*api.CastMessage))

func (*Channel) Request

func (c *Channel) Request(ctx context.Context, payload Payload) (*api.CastMessage, error)

func (*Channel) Send

func (c *Channel) Send(payload interface{}) error

type Connection

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

func NewConnection

func NewConnection() *Connection

func (*Connection) Close

func (c *Connection) Close() error

func (*Connection) Connect

func (c *Connection) Connect(ctx context.Context, host net.IP, port int) error

func (*Connection) NewChannel

func (c *Connection) NewChannel(sourceId, destinationId, namespace string) *Channel

func (*Connection) ReceiveLoop

func (c *Connection) ReceiveLoop()

func (*Connection) Send

func (c *Connection) Send(payload interface{}, sourceId, destinationId, namespace string) error

type Payload

type Payload interface {
	// contains filtered or unexported methods
}

type PayloadHeaders

type PayloadHeaders struct {
	Type      string `json:"type"`
	RequestId *int   `json:"requestId,omitempty"`
}

Jump to

Keyboard shortcuts

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