wire

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Wire_Transmit_FullMethodName = "/wire.Wire/Transmit"
)

Variables

View Source
var (
	LinkState_name = map[int32]string{
		0: "LINK_STATE_UNKNOWN",
		1: "LINK_STATE_UP",
		2: "LINK_STATE_DOWN",
	}
	LinkState_value = map[string]int32{
		"LINK_STATE_UNKNOWN": 0,
		"LINK_STATE_UP":      1,
		"LINK_STATE_DOWN":    2,
	}
)

Enum value maps for LinkState.

View Source
var Wire_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "wire.Wire",
	HandlerType: (*WireServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Transmit",
			Handler:       _Wire_Transmit_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "wire.proto",
}

Wire_ServiceDesc is the grpc.ServiceDesc for Wire service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterWireServer

func RegisterWireServer(s grpc.ServiceRegistrar, srv WireServer)

Types

type LinkState added in v0.3.5

type LinkState int32

LinkState is the carrier state of the interface at one end of a Wire.

const (
	// No link-state information. Receivers ignore it.
	LinkState_LINK_STATE_UNKNOWN LinkState = 0
	LinkState_LINK_STATE_UP      LinkState = 1
	LinkState_LINK_STATE_DOWN    LinkState = 2
)

func (LinkState) Descriptor added in v0.3.5

func (LinkState) Descriptor() protoreflect.EnumDescriptor

func (LinkState) Enum added in v0.3.5

func (x LinkState) Enum() *LinkState

func (LinkState) EnumDescriptor deprecated added in v0.3.5

func (LinkState) EnumDescriptor() ([]byte, []int)

Deprecated: Use LinkState.Descriptor instead.

func (LinkState) Number added in v0.3.5

func (x LinkState) Number() protoreflect.EnumNumber

func (LinkState) String added in v0.3.5

func (x LinkState) String() string

func (LinkState) Type added in v0.3.5

type Packet

type Packet struct {
	Data      []byte    `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	LinkState LinkState `protobuf:"varint,2,opt,name=link_state,json=linkState,proto3,enum=wire.LinkState" json:"link_state,omitempty"`
	// contains filtered or unexported fields
}

Packet carries a raw L2 frame, a link-state update, or both.

Receivers write data to the interface only when it is non-empty, and act on link_state only when it is not LINK_STATE_UNKNOWN. A bridge that receives LINK_STATE_UP or LINK_STATE_DOWN sets its interface administratively up or down, which the device at the other end of the link sees as a carrier change. A bridge sends LINK_STATE_UP or LINK_STATE_DOWN when the carrier of its interface changes while the interface is administratively up, and sends the current state once the stream is established.

func (*Packet) Descriptor deprecated

func (*Packet) Descriptor() ([]byte, []int)

Deprecated: Use Packet.ProtoReflect.Descriptor instead.

func (*Packet) GetData

func (x *Packet) GetData() []byte

func (*Packet) GetLinkState added in v0.3.5

func (x *Packet) GetLinkState() LinkState

func (*Packet) ProtoMessage

func (*Packet) ProtoMessage()

func (*Packet) ProtoReflect

func (x *Packet) ProtoReflect() protoreflect.Message

func (*Packet) Reset

func (x *Packet) Reset()

func (*Packet) String

func (x *Packet) String() string

type UnimplementedWireServer

type UnimplementedWireServer struct{}

UnimplementedWireServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedWireServer) Transmit

type UnsafeWireServer

type UnsafeWireServer interface {
	// contains filtered or unexported methods
}

UnsafeWireServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WireServer will result in compilation errors.

type WireClient

type WireClient interface {
	// Transmit sets up a bidirectional Packet stream.
	// Metadata can be configured to identify the destination.
	Transmit(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Packet, Packet], error)
}

WireClient is the client API for Wire service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

Wire service definition.

func NewWireClient

func NewWireClient(cc grpc.ClientConnInterface) WireClient

type WireServer

type WireServer interface {
	// Transmit sets up a bidirectional Packet stream.
	// Metadata can be configured to identify the destination.
	Transmit(grpc.BidiStreamingServer[Packet, Packet]) error
	// contains filtered or unexported methods
}

WireServer is the server API for Wire service. All implementations must embed UnimplementedWireServer for forward compatibility.

Wire service definition.

type Wire_TransmitClient

type Wire_TransmitClient = grpc.BidiStreamingClient[Packet, Packet]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Wire_TransmitServer

type Wire_TransmitServer = grpc.BidiStreamingServer[Packet, Packet]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

Jump to

Keyboard shortcuts

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