Skip to content

Import path: gitlab.soludian.com/soludian/fountain/libs/fnet/codec

codec

go
import "gitlab.soludian.com/soludian/fountain/libs/fnet/codec"

Index

Constants

go
const (
    KDefaultTCPCodecName  = "default_tcp_codec"
    KDefaultUDPCodecName  = "default_udp_codec"
    KDefaultQUICCodecName = "default_quic_codec"
)

go
const (
    KDefaultWriteTimeout = 5 * time.Second
)

Variables

go
var (
    // ErrorConnectionClosed indicates the connection is closed.
    ErrorConnectionClosed = errors.New("connection closed")
    // ErrorConnectionBlocked indicates the send channel is blocked.
    ErrorConnectionBlocked = errors.New("connection blocked")
)

Enum value maps for FrameType.

go
var (
    FrameType_name = map[int32]string{
        0:  "FRAME_TYPE_UNKNOWN",
        1:  "FRAME_TYPE_RST",
        2:  "FRAME_TYPE_CLOSE",
        3:  "FRAME_TYPE_DATA",
        4:  "FRAME_TYPE_FEEDBACK",
    }
    FrameType_value = map[string]int32{
        "FRAME_TYPE_UNKNOWN":  0,
        "FRAME_TYPE_RST":      1,
        "FRAME_TYPE_CLOSE":    2,
        "FRAME_TYPE_DATA":     3,
        "FRAME_TYPE_FEEDBACK": 4,
    }
)

go
var File_message_meta_proto protoreflect.FileDescriptor

go
var File_trans_message_proto protoreflect.FileDescriptor

PARSE_ERROR_TOO_BIG_DATA

go
var ProtoMagicNumber = []byte{'I', 'K', 'M', 'E'}

func NewMessageByName

go
func NewMessageByName(mName string) (proto.Message, error)

NewMessageByName func

func RegisterType

go
func RegisterType(x proto.Message, name string)

RegisterType func; Register a type of object that can send or receive over ftcp;

type AuthProtoMeta

go
type AuthProtoMeta struct {
    AuthKeyId    string `protobuf:"bytes,1,opt,name=auth_key_id,json=authKeyId,proto3" json:"auth_key_id,omitempty"`
    SessionId    string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
    MessageId    int64  `protobuf:"varint,3,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
    Layer        int32  `protobuf:"varint,4,opt,name=layer,proto3" json:"layer,omitempty"`
    UserId       string `protobuf:"bytes,5,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
    AccessHash   string `protobuf:"bytes,6,opt,name=access_hash,json=accessHash,proto3" json:"access_hash,omitempty"`
    ServerId     string `protobuf:"bytes,7,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"`
    ClientConnId int64  `protobuf:"varint,8,opt,name=client_conn_id,json=clientConnId,proto3" json:"client_conn_id,omitempty"`
    ClientAddr   string `protobuf:"bytes,9,opt,name=client_addr,json=clientAddr,proto3" json:"client_addr,omitempty"`
    From         string `protobuf:"bytes,10,opt,name=from,proto3" json:"from,omitempty"`
    ReceiveTime  int32  `protobuf:"varint,11,opt,name=receive_time,json=receiveTime,proto3" json:"receive_time,omitempty"`
    // contains filtered or unexported fields
}

func (*AuthProtoMeta) Descriptor

go
func (*AuthProtoMeta) Descriptor() ([]byte, []int)

Deprecated: Use AuthProtoMeta.ProtoReflect.Descriptor instead.

func (*AuthProtoMeta) GetAccessHash

go
func (x *AuthProtoMeta) GetAccessHash() string

func (*AuthProtoMeta) GetAuthKeyId

go
func (x *AuthProtoMeta) GetAuthKeyId() string

func (*AuthProtoMeta) GetClientAddr

go
func (x *AuthProtoMeta) GetClientAddr() string

func (*AuthProtoMeta) GetClientConnId

go
func (x *AuthProtoMeta) GetClientConnId() int64

func (*AuthProtoMeta) GetFrom

go
func (x *AuthProtoMeta) GetFrom() string

func (*AuthProtoMeta) GetLayer

go
func (x *AuthProtoMeta) GetLayer() int32

func (*AuthProtoMeta) GetMessageId

go
func (x *AuthProtoMeta) GetMessageId() int64

func (*AuthProtoMeta) GetReceiveTime

go
func (x *AuthProtoMeta) GetReceiveTime() int32

func (*AuthProtoMeta) GetServerId

go
func (x *AuthProtoMeta) GetServerId() string

func (*AuthProtoMeta) GetSessionId

go
func (x *AuthProtoMeta) GetSessionId() string

func (*AuthProtoMeta) GetUserId

go
func (x *AuthProtoMeta) GetUserId() string

func (*AuthProtoMeta) ProtoMessage

go
func (*AuthProtoMeta) ProtoMessage()

func (*AuthProtoMeta) ProtoReflect

go
func (x *AuthProtoMeta) ProtoReflect() protoreflect.Message

func (*AuthProtoMeta) Reset

go
func (x *AuthProtoMeta) Reset()

func (*AuthProtoMeta) String

go
func (x *AuthProtoMeta) String() string

type ChunkInfo

go
type ChunkInfo struct {
    StreamId int64 `protobuf:"varint,1,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"`
    ChunkId  int64 `protobuf:"varint,2,opt,name=chunk_id,json=chunkId,proto3" json:"chunk_id,omitempty"`
    // contains filtered or unexported fields
}

func (*ChunkInfo) Descriptor

go
func (*ChunkInfo) Descriptor() ([]byte, []int)

Deprecated: Use ChunkInfo.ProtoReflect.Descriptor instead.

func (*ChunkInfo) GetChunkId

go
func (x *ChunkInfo) GetChunkId() int64

func (*ChunkInfo) GetStreamId

go
func (x *ChunkInfo) GetStreamId() int64

func (*ChunkInfo) ProtoMessage

go
func (*ChunkInfo) ProtoMessage()

func (*ChunkInfo) ProtoReflect

go
func (x *ChunkInfo) ProtoReflect() protoreflect.Message

func (*ChunkInfo) Reset

go
func (x *ChunkInfo) Reset()

func (*ChunkInfo) String

go
func (x *ChunkInfo) String() string

type DefaultQUICCodec

DefaultQUICCodec implements QUICCodec interface

go
type DefaultQUICCodec struct {
    // contains filtered or unexported fields
}

func (*DefaultQUICCodec) Receive

go
func (c *DefaultQUICCodec) Receive() (*Message, error)

func (*DefaultQUICCodec) Send

go
func (c *DefaultQUICCodec) Send(ctx context.Context, msg any) error

msg can be of type *Message or any other type that has encode() method or []byte

type DefaultTCPCodec

go
type DefaultTCPCodec struct {
    *net.TCPConn
}

func (*DefaultTCPCodec) Receive

go
func (c *DefaultTCPCodec) Receive() (*Message, error)

func (*DefaultTCPCodec) Send

go
func (c *DefaultTCPCodec) Send(ctx context.Context, msg any) error

msg can be of type *Message or any other type that has encode() method or []byte

type DefaultUDPCodec

go
type DefaultUDPCodec struct {
    *net.UDPConn
}

func (*DefaultUDPCodec) Receive

go
func (c *DefaultUDPCodec) Receive() (*net.UDPAddr, *Message, error)

func (*DefaultUDPCodec) Send

go
func (c *DefaultUDPCodec) Send(ctx context.Context, addr *net.UDPAddr, msg any) error

msg can be of type *Message or any other type that has encode() method or []byte

type Feedback

go
type Feedback struct {
    ConsumedSize int64 `protobuf:"varint,1,opt,name=consumed_size,json=consumedSize,proto3" json:"consumed_size,omitempty"`
    // contains filtered or unexported fields
}

func (*Feedback) Descriptor

go
func (*Feedback) Descriptor() ([]byte, []int)

Deprecated: Use Feedback.ProtoReflect.Descriptor instead.

func (*Feedback) GetConsumedSize

go
func (x *Feedback) GetConsumedSize() int64

func (*Feedback) ProtoMessage

go
func (*Feedback) ProtoMessage()

func (*Feedback) ProtoReflect

go
func (x *Feedback) ProtoReflect() protoreflect.Message

func (*Feedback) Reset

go
func (x *Feedback) Reset()

func (*Feedback) String

go
func (x *Feedback) String() string

type FrameType

go
type FrameType int32

go
const (
    FrameType_FRAME_TYPE_UNKNOWN  FrameType = 0
    FrameType_FRAME_TYPE_RST      FrameType = 1
    FrameType_FRAME_TYPE_CLOSE    FrameType = 2
    FrameType_FRAME_TYPE_DATA     FrameType = 3
    FrameType_FRAME_TYPE_FEEDBACK FrameType = 4
)

func (FrameType) Descriptor

go
func (FrameType) Descriptor() protoreflect.EnumDescriptor

func (FrameType) Enum

go
func (x FrameType) Enum() *FrameType

func (FrameType) EnumDescriptor

go
func (FrameType) EnumDescriptor() ([]byte, []int)

Deprecated: Use FrameType.Descriptor instead.

func (FrameType) Number

go
func (x FrameType) Number() protoreflect.EnumNumber

func (FrameType) String

go
func (x FrameType) String() string

func (FrameType) Type

go
func (FrameType) Type() protoreflect.EnumType

type InitConnection

go
type InitConnection struct {
    MsgId      int64  `protobuf:"varint,1,opt,name=msg_id,json=msgId,proto3" json:"msg_id,omitempty"`
    ServerName string `protobuf:"bytes,2,opt,name=server_name,json=serverName,proto3" json:"server_name,omitempty"`
    ServerTime int64  `protobuf:"varint,3,opt,name=server_time,json=serverTime,proto3" json:"server_time,omitempty"`
    // contains filtered or unexported fields
}

func (*InitConnection) Descriptor

go
func (*InitConnection) Descriptor() ([]byte, []int)

Deprecated: Use InitConnection.ProtoReflect.Descriptor instead.

func (*InitConnection) GetMsgId

go
func (x *InitConnection) GetMsgId() int64

func (*InitConnection) GetServerName

go
func (x *InitConnection) GetServerName() string

func (*InitConnection) GetServerTime

go
func (x *InitConnection) GetServerTime() int64

func (*InitConnection) ProtoMessage

go
func (*InitConnection) ProtoMessage()

func (*InitConnection) ProtoReflect

go
func (x *InitConnection) ProtoReflect() protoreflect.Message

func (*InitConnection) Reset

go
func (x *InitConnection) Reset()

func (*InitConnection) String

go
func (x *InitConnection) String() string

type Message

go
type Message struct {
    Meta       *MessageMeta
    Payload    []byte
    Attachment []byte
}

func MakeMessage

go
func MakeMessage(cntl *MessageController, msg proto.Message) *Message

MakeTCPMessage func

func MakeQUICMessageWithController

go
func MakeQUICMessageWithController(cntl *MessageController, msg proto.Message) *Message

MakeQUICMessageWithController func - utility function for QUIC message creation with explicit controller

func (*Message) Encode

go
func (m *Message) Encode() []byte

Encode exports the internal encode method for external use

type MessageController

MessageController func

go
type MessageController struct {
    *MessageMeta
    Attachment []byte
    // contains filtered or unexported fields
}

func NewMessageController

go
func NewMessageController(parent ...*MessageController) *MessageController

NewMessageController func

func SplitMessage

go
func SplitMessage(msg *Message) (*MessageController, proto.Message, error)

SplitMessage func

func (*MessageController) Clone

go
func (c *MessageController) Clone() *MessageController

Clone func

func (*MessageController) Default

go
func (c *MessageController) Default(x proto.Message) *MessageController

Default func; Create new LogID, set MethodName by proto.MesssageName, set ServiceName to default is ftcp

func (*MessageController) DefaultForQUIC

go
func (c *MessageController) DefaultForQUIC(x proto.Message) *MessageController

DefaultForQUIC func; Create new LogID, set MethodName by proto.MesssageName, set ServiceName to default for QUIC

func (*MessageController) GetAttachment

go
func (c *MessageController) GetAttachment() []byte

GetAttachment func

func (*MessageController) GetClientAddr

go
func (c *MessageController) GetClientAddr() string

GetClientAddr func

func (*MessageController) MakeMessage

go
func (c *MessageController) MakeMessage(msg proto.Message) *Message

MakeTCPMessage func

func (*MessageController) MakeQUICMessage

go
func (c *MessageController) MakeQUICMessage(msg proto.Message) *Message

MakeQUICMessage func - specifically for QUIC protocol message creation

func (*MessageController) MoveAttachment

go
func (c *MessageController) MoveAttachment() []byte

MoveAttachment func

func (*MessageController) SetAccessHash

go
func (c *MessageController) SetAccessHash(v string) *MessageController

SetAccessHash func

func (*MessageController) SetAttachment

go
func (c *MessageController) SetAttachment(b []byte) *MessageController

SetAttachment func

func (*MessageController) SetAuthKeyID

go
func (c *MessageController) SetAuthKeyID(v string) *MessageController

SetAuthKeyID func

func (*MessageController) SetClientAddr

go
func (c *MessageController) SetClientAddr(v string) *MessageController

SetClientAddr func

func (*MessageController) SetClientConnID

go
func (c *MessageController) SetClientConnID(v int64) *MessageController

SetClientConnID func

func (*MessageController) SetCompressType

go
func (c *MessageController) SetCompressType(v int32) *MessageController

SetCompressType func

func (*MessageController) SetCorrelationID

go
func (c *MessageController) SetCorrelationID(v int64) *MessageController

SetCorrelationID func

func (*MessageController) SetDestinationServiceName

go
func (c *MessageController) SetDestinationServiceName(v string) *MessageController

SetDestinationServiceName func

func (*MessageController) SetErrorCode

go
func (c *MessageController) SetErrorCode(v int32) *MessageController

SetErrorCode func

func (*MessageController) SetErrorText

go
func (c *MessageController) SetErrorText(v string) *MessageController

SetErrorText func

func (*MessageController) SetFrom

go
func (c *MessageController) SetFrom(v string) *MessageController

SetFrom func

func (*MessageController) SetLayer

go
func (c *MessageController) SetLayer(v int32) *MessageController

SetLayer func

func (*MessageController) SetMessageID

go
func (c *MessageController) SetMessageID(v int64) *MessageController

SetMessageID func

func (*MessageController) SetMethodName

go
func (c *MessageController) SetMethodName(msg proto.Message) *MessageController

SetMethodName func

func (*MessageController) SetReceiveTime

go
func (c *MessageController) SetReceiveTime(v int32) *MessageController

SetReceiveTime func

func (*MessageController) SetServerID

go
func (c *MessageController) SetServerID(v string) *MessageController

SetServerID func

func (*MessageController) SetSessionID

go
func (c *MessageController) SetSessionID(v string) *MessageController

SetSessionID func

func (*MessageController) SetSourceServiceName

go
func (c *MessageController) SetSourceServiceName(v string) *MessageController

SetDestinationServiceName func

func (*MessageController) SetSpanID

go
func (c *MessageController) SetSpanID(uuid string) *MessageController

SetSpanID func

func (*MessageController) SetTraceID

go
func (c *MessageController) SetTraceID(uuid string) *MessageController

SetTraceID func

func (*MessageController) SetUserID

go
func (c *MessageController) SetUserID(v string) *MessageController

SetUserID func

func (*MessageController) String

go
func (c *MessageController) String() string

String func

type MessageMeta

go
type MessageMeta struct {
    Request      *RequestMeta  `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
    Response     *ResponseMeta `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"`
    CompressType int32         `protobuf:"varint,3,opt,name=compress_type,json=compressType,proto3" json:"compress_type,omitempty"`
    // If some requests are correlation, all of them will be have the same correlation_id
    CorrelationId      int64           `protobuf:"varint,4,opt,name=correlation_id,json=correlationId,proto3" json:"correlation_id,omitempty"`
    AttachmentSize     int32           `protobuf:"varint,5,opt,name=attachment_size,json=attachmentSize,proto3" json:"attachment_size,omitempty"`
    ChunkInfo          *ChunkInfo      `protobuf:"bytes,6,opt,name=chunk_info,json=chunkInfo,proto3" json:"chunk_info,omitempty"`
    AuthenticationData []byte          `protobuf:"bytes,7,opt,name=authentication_data,json=authenticationData,proto3" json:"authentication_data,omitempty"`
    StreamSettings     *StreamSettings `protobuf:"bytes,8,opt,name=stream_settings,json=streamSettings,proto3" json:"stream_settings,omitempty"`
    ProtoMeta          *AuthProtoMeta  `protobuf:"bytes,9,opt,name=proto_meta,json=protoMeta,proto3" json:"proto_meta,omitempty"`
    // contains filtered or unexported fields
}

func (*MessageMeta) Descriptor

go
func (*MessageMeta) Descriptor() ([]byte, []int)

Deprecated: Use MessageMeta.ProtoReflect.Descriptor instead.

func (*MessageMeta) GetAttachmentSize

go
func (x *MessageMeta) GetAttachmentSize() int32

func (*MessageMeta) GetAuthenticationData

go
func (x *MessageMeta) GetAuthenticationData() []byte

func (*MessageMeta) GetChunkInfo

go
func (x *MessageMeta) GetChunkInfo() *ChunkInfo

func (*MessageMeta) GetCompressType

go
func (x *MessageMeta) GetCompressType() int32

func (*MessageMeta) GetCorrelationId

go
func (x *MessageMeta) GetCorrelationId() int64

func (*MessageMeta) GetProtoMeta

go
func (x *MessageMeta) GetProtoMeta() *AuthProtoMeta

func (*MessageMeta) GetRequest

go
func (x *MessageMeta) GetRequest() *RequestMeta

func (*MessageMeta) GetResponse

go
func (x *MessageMeta) GetResponse() *ResponseMeta

func (*MessageMeta) GetStreamSettings

go
func (x *MessageMeta) GetStreamSettings() *StreamSettings

func (*MessageMeta) ProtoMessage

go
func (*MessageMeta) ProtoMessage()

func (*MessageMeta) ProtoReflect

go
func (x *MessageMeta) ProtoReflect() protoreflect.Message

func (*MessageMeta) Reset

go
func (x *MessageMeta) Reset()

func (*MessageMeta) String

go
func (x *MessageMeta) String() string

type Ping

go
type Ping struct {
    PingId int64 `protobuf:"varint,1,opt,name=ping_id,json=pingId,proto3" json:"ping_id,omitempty"`
    // contains filtered or unexported fields
}

func (*Ping) Descriptor

go
func (*Ping) Descriptor() ([]byte, []int)

Deprecated: Use Ping.ProtoReflect.Descriptor instead.

func (*Ping) GetPingId

go
func (x *Ping) GetPingId() int64

func (*Ping) ProtoMessage

go
func (*Ping) ProtoMessage()

func (*Ping) ProtoReflect

go
func (x *Ping) ProtoReflect() protoreflect.Message

func (*Ping) Reset

go
func (x *Ping) Reset()

func (*Ping) String

go
func (x *Ping) String() string

type PingDelayDisconnect

go
type PingDelayDisconnect struct {
    PingId          int64 `protobuf:"varint,1,opt,name=ping_id,json=pingId,proto3" json:"ping_id,omitempty"`
    DisconnectDelay int32 `protobuf:"varint,2,opt,name=disconnect_delay,json=disconnectDelay,proto3" json:"disconnect_delay,omitempty"`
    // contains filtered or unexported fields
}

func (*PingDelayDisconnect) Descriptor

go
func (*PingDelayDisconnect) Descriptor() ([]byte, []int)

Deprecated: Use PingDelayDisconnect.ProtoReflect.Descriptor instead.

func (*PingDelayDisconnect) GetDisconnectDelay

go
func (x *PingDelayDisconnect) GetDisconnectDelay() int32

func (*PingDelayDisconnect) GetPingId

go
func (x *PingDelayDisconnect) GetPingId() int64

func (*PingDelayDisconnect) ProtoMessage

go
func (*PingDelayDisconnect) ProtoMessage()

func (*PingDelayDisconnect) ProtoReflect

go
func (x *PingDelayDisconnect) ProtoReflect() protoreflect.Message

func (*PingDelayDisconnect) Reset

go
func (x *PingDelayDisconnect) Reset()

func (*PingDelayDisconnect) String

go
func (x *PingDelayDisconnect) String() string

type Pong

go
type Pong struct {
    PingId int64 `protobuf:"varint,1,opt,name=ping_id,json=pingId,proto3" json:"ping_id,omitempty"`
    PongId int64 `protobuf:"varint,2,opt,name=pong_id,json=pongId,proto3" json:"pong_id,omitempty"`
    // contains filtered or unexported fields
}

func (*Pong) Descriptor

go
func (*Pong) Descriptor() ([]byte, []int)

Deprecated: Use Pong.ProtoReflect.Descriptor instead.

func (*Pong) GetPingId

go
func (x *Pong) GetPingId() int64

func (*Pong) GetPongId

go
func (x *Pong) GetPongId() int64

func (*Pong) ProtoMessage

go
func (*Pong) ProtoMessage()

func (*Pong) ProtoReflect

go
func (x *Pong) ProtoReflect() protoreflect.Message

func (*Pong) Reset

go
func (x *Pong) Reset()

func (*Pong) String

go
func (x *Pong) String() string

type Protocol

Protocol type

go
type Protocol[T any] interface {
    // contains filtered or unexported methods
}

type ProtocolFunc

ProtocolFunc func

go
type ProtocolFunc[T any] func(rw io.ReadWriter) (T, error)

func (ProtocolFunc[T]) NewCodec

go
func (pf ProtocolFunc[T]) NewCodec(rw io.ReadWriter) (T, error)

NewCodec func

type QUICCodec

QUICCodec is the message codec for QUIC streams. The wire format is identical to TCPCodec (length-prefixed Message frames), so QUICCodec is kept as a type alias to avoid duplicating method sets while still letting fquic refer to "QUICCodec" in field declarations and signatures.

go
type QUICCodec = TCPCodec

type RequestMeta

go
type RequestMeta struct {

    // Service name
    FromServiceName string `protobuf:"bytes,1,opt,name=from_service_name,json=fromServiceName,proto3" json:"from_service_name,omitempty"`
    // Service name
    ToServiceName string `protobuf:"bytes,2,opt,name=to_service_name,json=toServiceName,proto3" json:"to_service_name,omitempty"`
    // Service request route
    MethodName string `protobuf:"bytes,3,opt,name=method_name,json=methodName,proto3" json:"method_name,omitempty"`
    // uuid, trace_id id, 1 request have 1 trace_id, if the request have trace_id, don't change it
    TraceId string `protobuf:"bytes,4,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"`
    // span_id; when the request go to a service that can be send to some func, every func need gen new span_id
    SpanId string `protobuf:"bytes,5,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"`
    // contains filtered or unexported fields
}

func (*RequestMeta) Descriptor

go
func (*RequestMeta) Descriptor() ([]byte, []int)

Deprecated: Use RequestMeta.ProtoReflect.Descriptor instead.

func (*RequestMeta) GetFromServiceName

go
func (x *RequestMeta) GetFromServiceName() string

func (*RequestMeta) GetMethodName

go
func (x *RequestMeta) GetMethodName() string

func (*RequestMeta) GetSpanId

go
func (x *RequestMeta) GetSpanId() string

func (*RequestMeta) GetToServiceName

go
func (x *RequestMeta) GetToServiceName() string

func (*RequestMeta) GetTraceId

go
func (x *RequestMeta) GetTraceId() string

func (*RequestMeta) NewSpanID

go
func (m *RequestMeta) NewSpanID() *RequestMeta

NewSpanID func; Create new traceID and spanID

func (*RequestMeta) NewTraceID

go
func (m *RequestMeta) NewTraceID(parent *RequestMeta) *RequestMeta

NewLogID func; Create new logID, traceID and spanID

func (*RequestMeta) ProtoMessage

go
func (*RequestMeta) ProtoMessage()

func (*RequestMeta) ProtoReflect

go
func (x *RequestMeta) ProtoReflect() protoreflect.Message

func (*RequestMeta) Reset

go
func (x *RequestMeta) Reset()

func (*RequestMeta) String

go
func (x *RequestMeta) String() string

type ResponseMeta

go
type ResponseMeta struct {
    ErrorCode int32  `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"`
    ErrorText string `protobuf:"bytes,2,opt,name=error_text,json=errorText,proto3" json:"error_text,omitempty"`
    // contains filtered or unexported fields
}

func (*ResponseMeta) Descriptor

go
func (*ResponseMeta) Descriptor() ([]byte, []int)

Deprecated: Use ResponseMeta.ProtoReflect.Descriptor instead.

func (*ResponseMeta) GetErrorCode

go
func (x *ResponseMeta) GetErrorCode() int32

func (*ResponseMeta) GetErrorText

go
func (x *ResponseMeta) GetErrorText() string

func (*ResponseMeta) ProtoMessage

go
func (*ResponseMeta) ProtoMessage()

func (*ResponseMeta) ProtoReflect

go
func (x *ResponseMeta) ProtoReflect() protoreflect.Message

func (*ResponseMeta) Reset

go
func (x *ResponseMeta) Reset()

func (*ResponseMeta) String

go
func (x *ResponseMeta) String() string

type StreamFrameMeta

go
type StreamFrameMeta struct {
    StreamId        int64     `protobuf:"varint,1,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"`
    SourceStreamId  int64     `protobuf:"varint,2,opt,name=source_stream_id,json=sourceStreamId,proto3" json:"source_stream_id,omitempty"`
    FrameType       FrameType `protobuf:"varint,3,opt,name=frame_type,json=frameType,proto3,enum=FrameType" json:"frame_type,omitempty"`
    HasContinuation bool      `protobuf:"varint,4,opt,name=has_continuation,json=hasContinuation,proto3" json:"has_continuation,omitempty"`
    Feedback        *Feedback `protobuf:"bytes,5,opt,name=feedback,proto3" json:"feedback,omitempty"`
    // contains filtered or unexported fields
}

func (*StreamFrameMeta) Descriptor

go
func (*StreamFrameMeta) Descriptor() ([]byte, []int)

Deprecated: Use StreamFrameMeta.ProtoReflect.Descriptor instead.

func (*StreamFrameMeta) GetFeedback

go
func (x *StreamFrameMeta) GetFeedback() *Feedback

func (*StreamFrameMeta) GetFrameType

go
func (x *StreamFrameMeta) GetFrameType() FrameType

func (*StreamFrameMeta) GetHasContinuation

go
func (x *StreamFrameMeta) GetHasContinuation() bool

func (*StreamFrameMeta) GetSourceStreamId

go
func (x *StreamFrameMeta) GetSourceStreamId() int64

func (*StreamFrameMeta) GetStreamId

go
func (x *StreamFrameMeta) GetStreamId() int64

func (*StreamFrameMeta) ProtoMessage

go
func (*StreamFrameMeta) ProtoMessage()

func (*StreamFrameMeta) ProtoReflect

go
func (x *StreamFrameMeta) ProtoReflect() protoreflect.Message

func (*StreamFrameMeta) Reset

go
func (x *StreamFrameMeta) Reset()

func (*StreamFrameMeta) String

go
func (x *StreamFrameMeta) String() string

type StreamSettings

go
type StreamSettings struct {
    StreamId     int64 `protobuf:"varint,1,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"`
    NeedFeedback bool  `protobuf:"varint,2,opt,name=need_feedback,json=needFeedback,proto3" json:"need_feedback,omitempty"`
    Writable     bool  `protobuf:"varint,3,opt,name=writable,proto3" json:"writable,omitempty"`
    // contains filtered or unexported fields
}

func (*StreamSettings) Descriptor

go
func (*StreamSettings) Descriptor() ([]byte, []int)

Deprecated: Use StreamSettings.ProtoReflect.Descriptor instead.

func (*StreamSettings) GetNeedFeedback

go
func (x *StreamSettings) GetNeedFeedback() bool

func (*StreamSettings) GetStreamId

go
func (x *StreamSettings) GetStreamId() int64

func (*StreamSettings) GetWritable

go
func (x *StreamSettings) GetWritable() bool

func (*StreamSettings) ProtoMessage

go
func (*StreamSettings) ProtoMessage()

func (*StreamSettings) ProtoReflect

go
func (x *StreamSettings) ProtoReflect() protoreflect.Message

func (*StreamSettings) Reset

go
func (x *StreamSettings) Reset()

func (*StreamSettings) String

go
func (x *StreamSettings) String() string

type TCPCodec

go
type TCPCodec interface {
    Receive() (msg *Message, err error)
    // msg can be of type *Message or any other type that has encode() method or []byte
    Send(ctx context.Context, msg any) error
}

func GetQUICCodecByName

go
func GetQUICCodecByName(name string) (TCPCodec, error)

GetQUICCodecByName func - Note: QUIC codec requires special initialization with stream and address

func GetTCPCodecByName

go
func GetTCPCodecByName(name string, rw io.ReadWriter) (TCPCodec, error)

GetTCPCodecByName func

func NewQUICCodec

go
func NewQUICCodec(conn *quic.Conn, remoteAddr net.Addr) TCPCodec

NewQUICCodec creates a new QUIC codec with stream and remote address

type Test

go
type Test struct {
    Message    string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
    CreateTime int32  `protobuf:"varint,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
    // contains filtered or unexported fields
}

func (*Test) Descriptor

go
func (*Test) Descriptor() ([]byte, []int)

Deprecated: Use Test.ProtoReflect.Descriptor instead.

func (*Test) GetCreateTime

go
func (x *Test) GetCreateTime() int32

func (*Test) GetMessage

go
func (x *Test) GetMessage() string

func (*Test) ProtoMessage

go
func (*Test) ProtoMessage()

func (*Test) ProtoReflect

go
func (x *Test) ProtoReflect() protoreflect.Message

func (*Test) Reset

go
func (x *Test) Reset()

func (*Test) String

go
func (x *Test) String() string

type UDPCodec

go
type UDPCodec interface {
    Receive() (addr *net.UDPAddr, msg *Message, err error)
    // msg can be of type *Message or any other type that has encode() method or []byte
    Send(ctx context.Context, addr *net.UDPAddr, msg any) error
}

func GetUDPCodecByName

go
func GetUDPCodecByName(name string, rw io.ReadWriter) (UDPCodec, error)

GetUDPCodecByName func

Generated by gomarkdoc