mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 05:15:47 +00:00
rename framing to framer
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
package framing
|
package framer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package framing
|
package framer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package framing
|
package framer
|
||||||
|
|
||||||
type SlipFramer struct {
|
type SlipFramer struct {
|
||||||
buffer []byte
|
buffer []byte
|
||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/jwetzell/showbridge-go/internal/config"
|
"github.com/jwetzell/showbridge-go/internal/config"
|
||||||
"github.com/jwetzell/showbridge-go/internal/framing"
|
"github.com/jwetzell/showbridge-go/internal/framer"
|
||||||
"github.com/jwetzell/showbridge-go/internal/route"
|
"github.com/jwetzell/showbridge-go/internal/route"
|
||||||
"go.bug.st/serial"
|
"go.bug.st/serial"
|
||||||
)
|
)
|
||||||
@@ -19,7 +19,7 @@ type SerialClient struct {
|
|||||||
ctx context.Context
|
ctx context.Context
|
||||||
router route.RouteIO
|
router route.RouteIO
|
||||||
Port string
|
Port string
|
||||||
Framer framing.Framer
|
Framer framer.Framer
|
||||||
Mode *serial.Mode
|
Mode *serial.Mode
|
||||||
port serial.Port
|
port serial.Port
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ func init() {
|
|||||||
return nil, fmt.Errorf("misc.serial.client framing method must be a string")
|
return nil, fmt.Errorf("misc.serial.client framing method must be a string")
|
||||||
}
|
}
|
||||||
|
|
||||||
framer, err := framing.GetFramer(framingMethodString)
|
framer, err := framer.GetFramer(framingMethodString)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/jwetzell/showbridge-go/internal/config"
|
"github.com/jwetzell/showbridge-go/internal/config"
|
||||||
"github.com/jwetzell/showbridge-go/internal/framing"
|
"github.com/jwetzell/showbridge-go/internal/framer"
|
||||||
"github.com/jwetzell/showbridge-go/internal/route"
|
"github.com/jwetzell/showbridge-go/internal/route"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TCPClient struct {
|
type TCPClient struct {
|
||||||
config config.ModuleConfig
|
config config.ModuleConfig
|
||||||
framer framing.Framer
|
framer framer.Framer
|
||||||
conn *net.TCPConn
|
conn *net.TCPConn
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
router route.RouteIO
|
router route.RouteIO
|
||||||
@@ -65,7 +65,7 @@ func init() {
|
|||||||
return nil, fmt.Errorf("net.tcp.client framing method must be a string")
|
return nil, fmt.Errorf("net.tcp.client framing method must be a string")
|
||||||
}
|
}
|
||||||
|
|
||||||
framer, err := framing.GetFramer(framingMethodString)
|
framer, err := framer.GetFramer(framingMethodString)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/jwetzell/showbridge-go/internal/config"
|
"github.com/jwetzell/showbridge-go/internal/config"
|
||||||
"github.com/jwetzell/showbridge-go/internal/framing"
|
"github.com/jwetzell/showbridge-go/internal/framer"
|
||||||
"github.com/jwetzell/showbridge-go/internal/route"
|
"github.com/jwetzell/showbridge-go/internal/route"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TCPServer struct {
|
type TCPServer struct {
|
||||||
config config.ModuleConfig
|
config config.ModuleConfig
|
||||||
Addr *net.TCPAddr
|
Addr *net.TCPAddr
|
||||||
Framer framing.Framer
|
Framer framer.Framer
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
router route.RouteIO
|
router route.RouteIO
|
||||||
quit chan interface{}
|
quit chan interface{}
|
||||||
@@ -55,7 +55,7 @@ func init() {
|
|||||||
return nil, fmt.Errorf("net.tcp.server framing method must be a string")
|
return nil, fmt.Errorf("net.tcp.server framing method must be a string")
|
||||||
}
|
}
|
||||||
|
|
||||||
framer, err := framing.GetFramer(framingMethodString)
|
framer, err := framer.GetFramer(framingMethodString)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user