vined

package
v0.0.0-...-42d3920 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_TOTAL_CHAN_SIZE  = 1024
	MAX_SINGLE_CHAN_SIZE = 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func (*Client) Handle

func (c *Client) Handle(ios map[string]io.ReadWriteCloser, address string)

func (*Client) IOLoop

func (c *Client) IOLoop(conn net.Conn, portName string)

read&wirte with net.TCPConn

func (*Client) Read

func (c *Client) Read(conn net.Conn, portName string)

func (*Client) Write

func (c *Client) Write(conn net.Conn, portName string)

type Message

type Message struct {
	NodeName string
	PortName string
	Data     []byte
}

type Options

type Options struct {
	ID int64 `flag:"node-id" cfg:"id"`

	TCPAddress     string `flag:"tcp-address"`
	ApiTCPAddress  string `flag:"api-tcp-address"`
	ApiHTTPAddress string `flag:"api-http-address"`

	Optserials []serial.OptionSerial `flag:"option-serial"`

	DataPath         string `flag:"data-path"`
	BroadcastAddress string `flag:"broadcast-address"`
}

func NewOptions

func NewOptions() *Options

type VINED

type VINED struct {
	ClientConnChan     map[string]chan string //key string is:client ip address,value string is serial portname
	MsgTxChan          map[string]chan []byte //key string is:serial port name,value is rx or tx serial data
	MsgRxChan          map[string]chan []byte
	MessageTotalRxChan chan Message
	MessageTotalTxChan chan Message
	ApiTCPConn         map[net.Conn]string //key string si :api tcp client conn,value is serial port name
	// contains filtered or unexported fields
}

func New

func New(opts *Options) *VINED

func (*VINED) Main

func (v *VINED) Main()

Jump to

Keyboard shortcuts

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