iop/apps/control-plane/internal/wire/edge.go
toki 7df7c6f52e chore: update control-plane edge wire baseline and related components
- Move completed review/plan artifacts to archive
- Update control-plane main, wire, edge components
- Update edge bootstrap runtime and controlplane connector
- Update generated proto files
2026-05-30 22:30:18 +09:00

35 lines
1.2 KiB
Go

package wire
import (
"google.golang.org/protobuf/proto"
proto_socket "git.toki-labs.com/toki/proto-socket/go"
iop "iop/proto/gen/iop"
)
// EdgeParserMap returns the proto-socket parser set for the Control Plane-Edge
// native TCP wire contract.
func EdgeParserMap() proto_socket.ParserMap {
return proto_socket.ParserMap{
proto_socket.TypeNameOf(&iop.EdgeHelloRequest{}): func(b []byte) (proto.Message, error) {
req := &iop.EdgeHelloRequest{}
return req, proto.Unmarshal(b, req)
},
proto_socket.TypeNameOf(&iop.EdgeHelloResponse{}): func(b []byte) (proto.Message, error) {
res := &iop.EdgeHelloResponse{}
return res, proto.Unmarshal(b, res)
},
proto_socket.TypeNameOf(&iop.EdgeStatusRequest{}): func(b []byte) (proto.Message, error) {
req := &iop.EdgeStatusRequest{}
return req, proto.Unmarshal(b, req)
},
proto_socket.TypeNameOf(&iop.EdgeStatusResponse{}): func(b []byte) (proto.Message, error) {
res := &iop.EdgeStatusResponse{}
return res, proto.Unmarshal(b, res)
},
proto_socket.TypeNameOf(&iop.EdgeNodeEvent{}): func(b []byte) (proto.Message, error) {
event := &iop.EdgeNodeEvent{}
return event, proto.Unmarshal(b, event)
},
}
}