tcp

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *bool

Bool returns a pointer to the bool value passed in.

func BoolMap

func BoolMap(src map[string]bool) map[string]*bool

BoolMap converts a string map of bool values into a string map of bool pointers

func BoolSlice

func BoolSlice(src []bool) []*bool

BoolSlice converts a slice of bool values into a slice of bool pointers

func BoolValue

func BoolValue(v *bool) bool

BoolValue returns the value of the bool pointer passed in or false if the pointer is nil.

func BoolValueMap

func BoolValueMap(src map[string]*bool) map[string]bool

BoolValueMap converts a string map of bool pointers into a string map of bool values

func BoolValueSlice

func BoolValueSlice(src []*bool) []bool

BoolValueSlice converts a slice of bool pointers into a slice of bool values

func Byte

func Byte(v byte) *byte

Byte returns a pointer to the byte value passed in.

func ByteMap

func ByteMap(src map[string]byte) map[string]*byte

ByteMap converts a string map of byte values into a string map of byte pointers

func ByteSlice

func ByteSlice(src []byte) []*byte

ByteSlice converts a slice of byte values into a slice of byte pointers

func ByteValue

func ByteValue(v *byte) byte

ByteValue returns the value of the byte pointer passed in or 0 if the pointer is nil.

func ByteValueMap

func ByteValueMap(src map[string]*byte) map[string]byte

ByteValueMap converts a string map of byte pointers into a string map of byte values

func ByteValueSlice

func ByteValueSlice(src []*byte) []byte

ByteValueSlice converts a slice of byte pointers into a slice of byte values

func Float32

func Float32(v float32) *float32

Float32 returns a pointer to the float32 value passed in.

func Float32Map

func Float32Map(src map[string]float32) map[string]*float32

Float32Map converts a string map of float32 values into a string map of float32 pointers

func Float32Slice

func Float32Slice(src []float32) []*float32

Float32Slice converts a slice of float32 values into a slice of float32 pointers

func Float32Value

func Float32Value(v *float32) float32

Float32Value returns the value of the float32 pointer passed in or 0 if the pointer is nil.

func Float32ValueMap

func Float32ValueMap(src map[string]*float32) map[string]float32

Float32ValueMap converts a string map of float32 pointers into a string map of float32 values

func Float32ValueSlice

func Float32ValueSlice(src []*float32) []float32

Float32ValueSlice converts a slice of float32 pointers into a slice of float32 values

func Float64

func Float64(v float64) *float64

Float64 returns a pointer to the float64 value passed in.

func Float64Value

func Float64Value(v *float64) float64

Float64Value returns the value of the float64 pointer passed in or 0 if the pointer is nil.

func Int

func Int(v int) *int

Int returns a pointer to the int value passed in.

func Int16

func Int16(v int16) *int16

Int16 returns a pointer to the int16 value passed in.

func Int16Map

func Int16Map(src map[string]int16) map[string]*int16

Int16Map converts a string map of int16 values into a string map of int16 pointers

func Int16Slice

func Int16Slice(src []int16) []*int16

Int16Slice converts a slice of int16 values into a slice of int16 pointers

func Int16Value

func Int16Value(v *int16) int16

Int16Value returns the value of the int16 pointer passed in or 0 if the pointer is nil.

func Int16ValueMap

func Int16ValueMap(src map[string]*int16) map[string]int16

Int16ValueMap converts a string map of int16 pointers into a string map of int16 values

func Int16ValueSlice

func Int16ValueSlice(src []*int16) []int16

Int16ValueSlice converts a slice of int16 pointers into a slice of int16 values

func Int32

func Int32(v int32) *int32

Int32 returns a pointer to the int32 value passed in.

func Int32Map

func Int32Map(src map[string]int32) map[string]*int32

Int32Map converts a string map of int32 values into a string map of int32 pointers

func Int32Slice

func Int32Slice(src []int32) []*int32

Int32Slice converts a slice of int32 values into a slice of int32 pointers

func Int32Value

func Int32Value(v *int32) int32

Int32Value returns the value of the int32 pointer passed in or 0 if the pointer is nil.

func Int32ValueMap

func Int32ValueMap(src map[string]*int32) map[string]int32

Int32ValueMap converts a string map of int32 pointers into a string map of int32 values

func Int32ValueSlice

func Int32ValueSlice(src []*int32) []int32

Int32ValueSlice converts a slice of int32 pointers into a slice of int32 values

func IntMap

func IntMap(src map[string]int) map[string]*int

IntMap converts a string map of int values into a string map of int pointers

func IntSlice

func IntSlice(src []int) []*int

IntSlice converts a slice of int values into a slice of int pointers

func IntValue

func IntValue(v *int) int

IntValue returns the value of the int pointer passed in or 0 if the pointer is nil.

func IntValueMap

func IntValueMap(src map[string]*int) map[string]int

IntValueMap converts a string map of int pointers into a string map of int values

func IntValueSlice

func IntValueSlice(src []*int) []int

IntValueSlice converts a slice of int pointers into a slice of int values

func Marshal

func Marshal(v interface{}) ([]byte, error)

func MarshalMessage

func MarshalMessage(message message.Message) ([]byte, error)

func Read

func Read(reader io.Reader) (*message.Message, error)

func ReadFloat32

func ReadFloat32(data io.Reader, length uint32) (*float32, error)

func ReadFloat64

func ReadFloat64(data io.Reader, length uint32) (*float64, error)

func ReadHeader

func ReadHeader(bytes io.Reader) (uint32, uint16, error)

func ReadInt16

func ReadInt16(data io.Reader, length uint32) (*int16, error)

func ReadInt32

func ReadInt32(data io.Reader, length uint32) (*int32, error)

func ReadInt64

func ReadInt64(data io.Reader, length uint32) (*int64, error)

func ReadInt8

func ReadInt8(data io.Reader, length uint32) (*int8, error)

func ReadString

func ReadString(data io.Reader, length uint32) (*string, error)

func ReadUint16

func ReadUint16(data io.Reader, length uint32) (*uint16, error)

func ReadUint32

func ReadUint32(data io.Reader, length uint32) (*uint32, error)

func ReadUint64

func ReadUint64(data io.Reader, length uint32) (*uint64, error)

func ReadUint8

func ReadUint8(data io.Reader, length uint32) (*uint8, error)

func String

func String(v string) *string

String returns a pointer to the string value passed in.

func StringMap

func StringMap(src map[string]string) map[string]*string

StringMap converts a string map of string values into a string map of string pointers

func StringSlice

func StringSlice(src []string) []*string

StringSlice converts a slice of string values into a slice of string pointers

func StringValue

func StringValue(v *string) string

StringValue returns the value of the string pointer passed in or "" if the pointer is nil.

func StringValueMap

func StringValueMap(src map[string]*string) map[string]string

StringValueMap converts a string map of string pointers into a string map of string values

func StringValueSlice

func StringValueSlice(src []*string) []string

StringValueSlice converts a slice of string pointers into a slice of string values

func Uint16

func Uint16(v uint16) *uint16

Uint16 returns a pointer to the uint16 value passed in.

func Uint16Map

func Uint16Map(src map[string]uint16) map[string]*uint16

Uint16Map converts a string map of uint16 values into a string map of uint16 pointers

func Uint16Slice

func Uint16Slice(src []uint16) []*uint16

Uint16Slice converts a slice of uint16 values into a slice of uint16 pointers

func Uint16Value

func Uint16Value(v *uint16) uint16

Uint16Value returns the value of the uint16 pointer passed in or 0 if the pointer is nil.

func Uint16ValueMap

func Uint16ValueMap(src map[string]*uint16) map[string]uint16

Uint16ValueMap converts a string map of uint16 pointers into a string map of uint16 values

func Uint16ValueSlice

func Uint16ValueSlice(src []*uint16) []uint16

Uint16ValueSlice converts a slice of uint16 pointers into a slice of uint16 values

func Uint32

func Uint32(v uint32) *uint32

Uint32 returns a pointer to the uint32 value passed in.

func Uint32Map

func Uint32Map(src map[string]uint32) map[string]*uint32

Uint32Map converts a string map of uint32 values into a string map of uint32 pointers

func Uint32Slice

func Uint32Slice(src []uint32) []*uint32

Uint32Slice converts a slice of uint32 values into a slice of uint32 pointers

func Uint32Value

func Uint32Value(v *uint32) uint32

Uint32Value returns the value of the uint32 pointer passed in or 0 if the pointer is nil.

func Uint32ValueMap

func Uint32ValueMap(src map[string]*uint32) map[string]uint32

Uint32ValueMap converts a string map of uint32 pointers into a string map of uint32 values

func Uint32ValueSlice

func Uint32ValueSlice(src []*uint32) []uint32

Uint32ValueSlice converts a slice of uint32 pointers into a slice of uint32 values

func Uint8

func Uint8(v uint8) *uint8

Uint8 returns a pointer to the uint8 value passed in.

func Uint8Map

func Uint8Map(src map[string]uint8) map[string]*uint8

Uint8Map converts a string map of uint8 values into a string map of uint8 pointers

func Uint8Slice

func Uint8Slice(src []uint8) []*uint8

Uint8Slice converts a slice of uint8 values into a slice of uint8 pointers

func Uint8Value

func Uint8Value(v *uint8) uint8

Uint8Value returns the value of the uint8 pointer passed in or 0 if the pointer is nil.

func Uint8ValueMap

func Uint8ValueMap(src map[string]*uint8) map[string]uint8

Uint8ValueMap converts a string map of uint8 pointers into a string map of uint8 values

func Uint8ValueSlice

func Uint8ValueSlice(src []*uint8) []uint8

Uint8ValueSlice converts a slice of uint8 pointers into a slice of uint8 values

Types

type Client

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

func New

func New() *Client

func NewWithHandler

func NewWithHandler(messageHandler func(*message.Message) (keepMessage bool, err error)) *Client

func (*Client) Close

func (c *Client) Close() error

func (*Client) ConnectWithType

func (c *Client) ConnectWithType(address string, typ message.ClientTyp) error

func (*Client) Receive

func (c *Client) Receive() (*message.Message, error)

func (*Client) Send

func (c *Client) Send(message message.Message) error

Directories

Path Synopsis
fst

Jump to

Keyboard shortcuts

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