protocol

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

protcol package provides packages with various communication protocols support that fulfils Protocol interface

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCommandNotFound = errors.New("command not found")
	ErrParamNotFound   = errors.New("parameter not found")
	ErrWrongSetVal     = errors.New("could not set")
)

Functions

This section is empty.

Types

type Protocol

type Protocol interface {
	Decode(data []byte) ([]Transaction, error)
	Encode(txs []Transaction) ([]byte, error)
	Trigger(cmdName string) Transaction
}

type Transaction

type Transaction struct {
	Typ         TransactionType
	CommandName string
	Payload     map[string]any
}

type TransactionType

type TransactionType int
const (
	TxUnknown TransactionType = iota

	TxGetParam
	TxSetParam

	TxMismatch
)

func (TransactionType) String

func (t TransactionType) String() string

Directories

Path Synopsis
string stream protocol package provides a simple and efficient way to parse lab device communication streams
string stream protocol package provides a simple and efficient way to parse lab device communication streams

Jump to

Keyboard shortcuts

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