cproto

package
v1.0.20 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 8 Imported by: 0

README

Protobuf 生成

安装生成器:

go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.11

AGP 协议定义��?agp.proto,生成的 Go 文件与其他框��?PB 类型统一放在当前目录��? 框架协议运行 make protoc。业��?proto 使用标准 --go_out 生成 PB 类型,Actor 使用 Methods().Register(MethodID, handler) 注册方法��?

Documentation

Index

Constants

View Source
const (
	// System method IDs are reserved for connection control and cannot be
	// registered by business Actors.
	SystemMethodHandshake uint32 = 1
	SystemMethodHeartbeat uint32 = 2
	SystemMethodCancel    uint32 = 3
	SystemMethodGoAway    uint32 = 4
	SystemMethodKick      uint32 = 5
)
View Source
const DefaultMaxPacketSize = 4 << 20

DefaultMaxPacketSize is the maximum encoded AGP packet size (4 MiB).

Variables

View Source
var (
	StatusCode_name = map[int32]string{
		0:  "STATUS_OK",
		1:  "STATUS_CANCELLED",
		2:  "STATUS_INVALID_ARGUMENT",
		3:  "STATUS_DEADLINE_EXCEEDED",
		4:  "STATUS_NOT_FOUND",
		5:  "STATUS_ALREADY_EXISTS",
		6:  "STATUS_PERMISSION_DENIED",
		7:  "STATUS_UNAUTHENTICATED",
		8:  "STATUS_RESOURCE_EXHAUSTED",
		9:  "STATUS_FAILED_PRECONDITION",
		10: "STATUS_ABORTED",
		11: "STATUS_INTERNAL",
		12: "STATUS_UNAVAILABLE",
		13: "STATUS_UNSUPPORTED_MEDIA",
	}
	StatusCode_value = map[string]int32{
		"STATUS_OK":                  0,
		"STATUS_CANCELLED":           1,
		"STATUS_INVALID_ARGUMENT":    2,
		"STATUS_DEADLINE_EXCEEDED":   3,
		"STATUS_NOT_FOUND":           4,
		"STATUS_ALREADY_EXISTS":      5,
		"STATUS_PERMISSION_DENIED":   6,
		"STATUS_UNAUTHENTICATED":     7,
		"STATUS_RESOURCE_EXHAUSTED":  8,
		"STATUS_FAILED_PRECONDITION": 9,
		"STATUS_ABORTED":             10,
		"STATUS_INTERNAL":            11,
		"STATUS_UNAVAILABLE":         12,
		"STATUS_UNSUPPORTED_MEDIA":   13,
	}
)

Enum value maps for StatusCode.

View Source
var (
	MsgType_name = map[int32]string{
		0: "REQUEST",
		1: "RESPONSE",
		2: "NOTIFY",
	}
	MsgType_value = map[string]int32{
		"REQUEST":  0,
		"RESPONSE": 1,
		"NOTIFY":   2,
	}
)

Enum value maps for MsgType.

View Source
var File_net_proto_agp_proto protoreflect.FileDescriptor
View Source
var File_net_proto_base_type_proto protoreflect.FileDescriptor
View Source
var File_net_proto_cluster_message_proto protoreflect.FileDescriptor
View Source
var File_net_proto_proto_proto protoreflect.FileDescriptor

Functions

func ValidatePacket added in v1.0.20

func ValidatePacket(packet *Packet, limits Limits) error

ValidatePacket checks structural invariants before a packet reaches routing.

Types

type Bool added in v1.0.8

type Bool struct {
	Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Bool) Descriptor deprecated added in v1.0.8

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

Deprecated: Use Bool.ProtoReflect.Descriptor instead.

func (*Bool) GetValue added in v1.0.8

func (x *Bool) GetValue() bool

func (*Bool) ProtoMessage added in v1.0.8

func (*Bool) ProtoMessage()

func (*Bool) ProtoReflect added in v1.0.8

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

func (*Bool) Reset added in v1.0.8

func (x *Bool) Reset()

func (*Bool) String added in v1.0.8

func (x *Bool) String() string

type CancelNotify added in v1.0.20

type CancelNotify struct {
	RequestId uint32 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// contains filtered or unexported fields
}

CancelNotify cancels an in-flight Request on the same connection.

func (*CancelNotify) Descriptor deprecated added in v1.0.20

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

Deprecated: Use CancelNotify.ProtoReflect.Descriptor instead.

func (*CancelNotify) GetRequestId added in v1.0.20

func (x *CancelNotify) GetRequestId() uint32

func (*CancelNotify) ProtoMessage added in v1.0.20

func (*CancelNotify) ProtoMessage()

func (*CancelNotify) ProtoReflect added in v1.0.20

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

func (*CancelNotify) Reset added in v1.0.20

func (x *CancelNotify) Reset()

func (*CancelNotify) String added in v1.0.20

func (x *CancelNotify) String() string

type ClusterMessage added in v1.0.20

type ClusterMessage struct {
	MessageId      uint64            `protobuf:"varint,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
	MsgType        MsgType           `protobuf:"varint,2,opt,name=msg_type,json=msgType,proto3,enum=actorgo.cluster.v1.MsgType" json:"msg_type,omitempty"`
	RequestId      uint32            `protobuf:"varint,3,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	MethodId       uint32            `protobuf:"varint,4,opt,name=method_id,json=methodId,proto3" json:"method_id,omitempty"`
	DeadlineUnixMs int64             `protobuf:"varint,5,opt,name=deadline_unix_ms,json=deadlineUnixMs,proto3" json:"deadline_unix_ms,omitempty"` // Absolute deadline preserves one budget across hops.
	TargetPath     string            `protobuf:"bytes,6,opt,name=target_path,json=targetPath,proto3" json:"target_path,omitempty"`                // Optional; only used for an explicit child Actor.
	Session        *Session          `protobuf:"bytes,7,opt,name=session,proto3" json:"session,omitempty"`                                        // Snapshot of caller session; same layout as local Session.
	Metadata       map[string][]byte ``                                                                                                           /* 143-byte string literal not displayed */
	Codec          int32             `protobuf:"varint,9,opt,name=codec,proto3" json:"codec,omitempty"`
	Payload        []byte            `protobuf:"bytes,10,opt,name=payload,proto3" json:"payload,omitempty"`
	Code           int32             `protobuf:"varint,11,opt,name=code,proto3" json:"code,omitempty"`      // Response status; zero for requests and notifications.
	Message        string            `protobuf:"bytes,12,opt,name=message,proto3" json:"message,omitempty"` // Response error text.
	// contains filtered or unexported fields
}

ClusterMessage is the protobuf-only NATS message. payload uses codec, matching the original AGP or HTTP request body encoding.

func (*ClusterMessage) Descriptor deprecated added in v1.0.20

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

Deprecated: Use ClusterMessage.ProtoReflect.Descriptor instead.

func (*ClusterMessage) GetCode added in v1.0.20

func (x *ClusterMessage) GetCode() int32

func (*ClusterMessage) GetCodec added in v1.0.20

func (x *ClusterMessage) GetCodec() int32

func (*ClusterMessage) GetDeadlineUnixMs added in v1.0.20

func (x *ClusterMessage) GetDeadlineUnixMs() int64

func (*ClusterMessage) GetMessage added in v1.0.20

func (x *ClusterMessage) GetMessage() string

func (*ClusterMessage) GetMessageId added in v1.0.20

func (x *ClusterMessage) GetMessageId() uint64

func (*ClusterMessage) GetMetadata added in v1.0.20

func (x *ClusterMessage) GetMetadata() map[string][]byte

func (*ClusterMessage) GetMethodId added in v1.0.20

func (x *ClusterMessage) GetMethodId() uint32

func (*ClusterMessage) GetMsgType added in v1.0.20

func (x *ClusterMessage) GetMsgType() MsgType

func (*ClusterMessage) GetPayload added in v1.0.20

func (x *ClusterMessage) GetPayload() []byte

func (*ClusterMessage) GetRequestId added in v1.0.20

func (x *ClusterMessage) GetRequestId() uint32

func (*ClusterMessage) GetSession added in v1.0.20

func (x *ClusterMessage) GetSession() *Session

func (*ClusterMessage) GetTargetPath added in v1.0.20

func (x *ClusterMessage) GetTargetPath() string

func (*ClusterMessage) ProtoMessage added in v1.0.20

func (*ClusterMessage) ProtoMessage()

func (*ClusterMessage) ProtoReflect added in v1.0.20

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

func (*ClusterMessage) Reset added in v1.0.20

func (x *ClusterMessage) Reset()

func (*ClusterMessage) String added in v1.0.20

func (x *ClusterMessage) String() string

type Double added in v1.0.8

type Double struct {
	Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Double) Descriptor deprecated added in v1.0.8

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

Deprecated: Use Double.ProtoReflect.Descriptor instead.

func (*Double) GetValue added in v1.0.8

func (x *Double) GetValue() float64

func (*Double) ProtoMessage added in v1.0.8

func (*Double) ProtoMessage()

func (*Double) ProtoReflect added in v1.0.8

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

func (*Double) Reset added in v1.0.8

func (x *Double) Reset()

func (*Double) String added in v1.0.8

func (x *Double) String() string

type GoAwayNotify added in v1.0.20

type GoAwayNotify struct {
	ReasonCode   int32  `protobuf:"varint,1,opt,name=reason_code,json=reasonCode,proto3" json:"reason_code,omitempty"`
	RetryAfterMs uint32 `protobuf:"varint,2,opt,name=retry_after_ms,json=retryAfterMs,proto3" json:"retry_after_ms,omitempty"`
	// contains filtered or unexported fields
}

GoAwayNotify is used during graceful server shutdown.

func (*GoAwayNotify) Descriptor deprecated added in v1.0.20

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

Deprecated: Use GoAwayNotify.ProtoReflect.Descriptor instead.

func (*GoAwayNotify) GetReasonCode added in v1.0.20

func (x *GoAwayNotify) GetReasonCode() int32

func (*GoAwayNotify) GetRetryAfterMs added in v1.0.20

func (x *GoAwayNotify) GetRetryAfterMs() uint32

func (*GoAwayNotify) ProtoMessage added in v1.0.20

func (*GoAwayNotify) ProtoMessage()

func (*GoAwayNotify) ProtoReflect added in v1.0.20

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

func (*GoAwayNotify) Reset added in v1.0.20

func (x *GoAwayNotify) Reset()

func (*GoAwayNotify) String added in v1.0.20

func (x *GoAwayNotify) String() string

type HTTPError added in v1.0.20

type HTTPError struct {
	Code      int32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Message   string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	RequestId string `protobuf:"bytes,3,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// contains filtered or unexported fields
}

HTTPError is the stable error body returned by the curl/HTTP adapter.

func (*HTTPError) Descriptor deprecated added in v1.0.20

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

Deprecated: Use HTTPError.ProtoReflect.Descriptor instead.

func (*HTTPError) GetCode added in v1.0.20

func (x *HTTPError) GetCode() int32

func (*HTTPError) GetMessage added in v1.0.20

func (x *HTTPError) GetMessage() string

func (*HTTPError) GetRequestId added in v1.0.20

func (x *HTTPError) GetRequestId() string

func (*HTTPError) ProtoMessage added in v1.0.20

func (*HTTPError) ProtoMessage()

func (*HTTPError) ProtoReflect added in v1.0.20

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

func (*HTTPError) Reset added in v1.0.20

func (x *HTTPError) Reset()

func (*HTTPError) String added in v1.0.20

func (x *HTTPError) String() string

type HandshakeRequest added in v1.0.20

type HandshakeRequest struct {
	SupportedVersions []uint32 `protobuf:"varint,1,rep,packed,name=supported_versions,json=supportedVersions,proto3" json:"supported_versions,omitempty"`
	// contains filtered or unexported fields
}

HandshakeRequest negotiates the highest protocol version supported by both ends.

func (*HandshakeRequest) Descriptor deprecated added in v1.0.20

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

Deprecated: Use HandshakeRequest.ProtoReflect.Descriptor instead.

func (*HandshakeRequest) GetSupportedVersions added in v1.0.20

func (x *HandshakeRequest) GetSupportedVersions() []uint32

func (*HandshakeRequest) ProtoMessage added in v1.0.20

func (*HandshakeRequest) ProtoMessage()

func (*HandshakeRequest) ProtoReflect added in v1.0.20

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

func (*HandshakeRequest) Reset added in v1.0.20

func (x *HandshakeRequest) Reset()

func (*HandshakeRequest) String added in v1.0.20

func (x *HandshakeRequest) String() string

type HandshakeResponse added in v1.0.20

type HandshakeResponse struct {
	ProtocolVersion     uint32 `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"`
	HeartbeatIntervalMs uint32 `protobuf:"varint,2,opt,name=heartbeat_interval_ms,json=heartbeatIntervalMs,proto3" json:"heartbeat_interval_ms,omitempty"`
	MaxFrameSize        uint32 `protobuf:"varint,3,opt,name=max_frame_size,json=maxFrameSize,proto3" json:"max_frame_size,omitempty"`
	ConnectionId        string `protobuf:"bytes,4,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"`
	// contains filtered or unexported fields
}

HandshakeResponse publishes connection-level limits selected by the server.

func (*HandshakeResponse) Descriptor deprecated added in v1.0.20

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

Deprecated: Use HandshakeResponse.ProtoReflect.Descriptor instead.

func (*HandshakeResponse) GetConnectionId added in v1.0.20

func (x *HandshakeResponse) GetConnectionId() string

func (*HandshakeResponse) GetHeartbeatIntervalMs added in v1.0.20

func (x *HandshakeResponse) GetHeartbeatIntervalMs() uint32

func (*HandshakeResponse) GetMaxFrameSize added in v1.0.20

func (x *HandshakeResponse) GetMaxFrameSize() uint32

func (*HandshakeResponse) GetProtocolVersion added in v1.0.20

func (x *HandshakeResponse) GetProtocolVersion() uint32

func (*HandshakeResponse) ProtoMessage added in v1.0.20

func (*HandshakeResponse) ProtoMessage()

func (*HandshakeResponse) ProtoReflect added in v1.0.20

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

func (*HandshakeResponse) Reset added in v1.0.20

func (x *HandshakeResponse) Reset()

func (*HandshakeResponse) String added in v1.0.20

func (x *HandshakeResponse) String() string

type HeartbeatRequest added in v1.0.20

type HeartbeatRequest struct {
	ClientTimeMs int64 `protobuf:"varint,1,opt,name=client_time_ms,json=clientTimeMs,proto3" json:"client_time_ms,omitempty"`
	// contains filtered or unexported fields
}

HeartbeatRequest and HeartbeatResponse measure liveness without Actor routing.

func (*HeartbeatRequest) Descriptor deprecated added in v1.0.20

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

Deprecated: Use HeartbeatRequest.ProtoReflect.Descriptor instead.

func (*HeartbeatRequest) GetClientTimeMs added in v1.0.20

func (x *HeartbeatRequest) GetClientTimeMs() int64

func (*HeartbeatRequest) ProtoMessage added in v1.0.20

func (*HeartbeatRequest) ProtoMessage()

func (*HeartbeatRequest) ProtoReflect added in v1.0.20

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

func (*HeartbeatRequest) Reset added in v1.0.20

func (x *HeartbeatRequest) Reset()

func (*HeartbeatRequest) String added in v1.0.20

func (x *HeartbeatRequest) String() string

type HeartbeatResponse added in v1.0.20

type HeartbeatResponse struct {
	ClientTimeMs int64 `protobuf:"varint,1,opt,name=client_time_ms,json=clientTimeMs,proto3" json:"client_time_ms,omitempty"`
	ServerTimeMs int64 `protobuf:"varint,2,opt,name=server_time_ms,json=serverTimeMs,proto3" json:"server_time_ms,omitempty"`
	// contains filtered or unexported fields
}

func (*HeartbeatResponse) Descriptor deprecated added in v1.0.20

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

Deprecated: Use HeartbeatResponse.ProtoReflect.Descriptor instead.

func (*HeartbeatResponse) GetClientTimeMs added in v1.0.20

func (x *HeartbeatResponse) GetClientTimeMs() int64

func (*HeartbeatResponse) GetServerTimeMs added in v1.0.20

func (x *HeartbeatResponse) GetServerTimeMs() int64

func (*HeartbeatResponse) ProtoMessage added in v1.0.20

func (*HeartbeatResponse) ProtoMessage()

func (*HeartbeatResponse) ProtoReflect added in v1.0.20

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

func (*HeartbeatResponse) Reset added in v1.0.20

func (x *HeartbeatResponse) Reset()

func (*HeartbeatResponse) String added in v1.0.20

func (x *HeartbeatResponse) String() string

type I32

type I32 struct {
	Value int32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*I32) Descriptor deprecated

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

Deprecated: Use I32.ProtoReflect.Descriptor instead.

func (*I32) GetValue

func (x *I32) GetValue() int32

func (*I32) ProtoMessage

func (*I32) ProtoMessage()

func (*I32) ProtoReflect

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

func (*I32) Reset

func (x *I32) Reset()

func (*I32) String

func (x *I32) String() string

type Int32 added in v1.0.8

type Int32 struct {
	Value int32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Int32) Descriptor deprecated added in v1.0.8

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

Deprecated: Use Int32.ProtoReflect.Descriptor instead.

func (*Int32) GetValue added in v1.0.8

func (x *Int32) GetValue() int32

func (*Int32) ProtoMessage added in v1.0.8

func (*Int32) ProtoMessage()

func (*Int32) ProtoReflect added in v1.0.8

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

func (*Int32) Reset added in v1.0.8

func (x *Int32) Reset()

func (*Int32) String added in v1.0.8

func (x *Int32) String() string

type Int32Int32 added in v1.0.8

type Int32Int32 struct {
	Key   int32 `protobuf:"varint,1,opt,name=key,proto3" json:"key,omitempty"`
	Value int32 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Int32Int32) Descriptor deprecated added in v1.0.8

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

Deprecated: Use Int32Int32.ProtoReflect.Descriptor instead.

func (*Int32Int32) GetKey added in v1.0.8

func (x *Int32Int32) GetKey() int32

func (*Int32Int32) GetValue added in v1.0.8

func (x *Int32Int32) GetValue() int32

func (*Int32Int32) ProtoMessage added in v1.0.8

func (*Int32Int32) ProtoMessage()

func (*Int32Int32) ProtoReflect added in v1.0.8

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

func (*Int32Int32) Reset added in v1.0.8

func (x *Int32Int32) Reset()

func (*Int32Int32) String added in v1.0.8

func (x *Int32Int32) String() string

type Int32Int64 added in v1.0.8

type Int32Int64 struct {
	Key   int32 `protobuf:"varint,1,opt,name=key,proto3" json:"key,omitempty"`
	Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Int32Int64) Descriptor deprecated added in v1.0.8

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

Deprecated: Use Int32Int64.ProtoReflect.Descriptor instead.

func (*Int32Int64) GetKey added in v1.0.8

func (x *Int32Int64) GetKey() int32

func (*Int32Int64) GetValue added in v1.0.8

func (x *Int32Int64) GetValue() int64

func (*Int32Int64) ProtoMessage added in v1.0.8

func (*Int32Int64) ProtoMessage()

func (*Int32Int64) ProtoReflect added in v1.0.8

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

func (*Int32Int64) Reset added in v1.0.8

func (x *Int32Int64) Reset()

func (*Int32Int64) String added in v1.0.8

func (x *Int32Int64) String() string

type Int32Int64Map added in v1.0.8

type Int32Int64Map struct {
	Value map[int32]int64 `` /* 139-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Int32Int64Map) Descriptor deprecated added in v1.0.8

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

Deprecated: Use Int32Int64Map.ProtoReflect.Descriptor instead.

func (*Int32Int64Map) GetValue added in v1.0.8

func (x *Int32Int64Map) GetValue() map[int32]int64

func (*Int32Int64Map) ProtoMessage added in v1.0.8

func (*Int32Int64Map) ProtoMessage()

func (*Int32Int64Map) ProtoReflect added in v1.0.8

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

func (*Int32Int64Map) Reset added in v1.0.8

func (x *Int32Int64Map) Reset()

func (*Int32Int64Map) String added in v1.0.8

func (x *Int32Int64Map) String() string

type Int32List added in v1.0.8

type Int32List struct {
	List []int32 `protobuf:"varint,1,rep,packed,name=list,proto3" json:"list,omitempty"`
	// contains filtered or unexported fields
}

func (*Int32List) Descriptor deprecated added in v1.0.8

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

Deprecated: Use Int32List.ProtoReflect.Descriptor instead.

func (*Int32List) GetList added in v1.0.8

func (x *Int32List) GetList() []int32

func (*Int32List) ProtoMessage added in v1.0.8

func (*Int32List) ProtoMessage()

func (*Int32List) ProtoReflect added in v1.0.8

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

func (*Int32List) Reset added in v1.0.8

func (x *Int32List) Reset()

func (*Int32List) String added in v1.0.8

func (x *Int32List) String() string

type Int32Map added in v1.0.8

type Int32Map struct {
	Value map[int32]int32 `` /* 139-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Int32Map) Descriptor deprecated added in v1.0.8

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

Deprecated: Use Int32Map.ProtoReflect.Descriptor instead.

func (*Int32Map) GetValue added in v1.0.8

func (x *Int32Map) GetValue() map[int32]int32

func (*Int32Map) ProtoMessage added in v1.0.8

func (*Int32Map) ProtoMessage()

func (*Int32Map) ProtoReflect added in v1.0.8

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

func (*Int32Map) Reset added in v1.0.8

func (x *Int32Map) Reset()

func (*Int32Map) String added in v1.0.8

func (x *Int32Map) String() string

type Int64 added in v1.0.8

type Int64 struct {
	Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Int64) Descriptor deprecated added in v1.0.8

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

Deprecated: Use Int64.ProtoReflect.Descriptor instead.

func (*Int64) GetValue added in v1.0.8

func (x *Int64) GetValue() int64

func (*Int64) ProtoMessage added in v1.0.8

func (*Int64) ProtoMessage()

func (*Int64) ProtoReflect added in v1.0.8

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

func (*Int64) Reset added in v1.0.8

func (x *Int64) Reset()

func (*Int64) String added in v1.0.8

func (x *Int64) String() string

type Int64Int32 added in v1.0.8

type Int64Int32 struct {
	Key   int64 `protobuf:"varint,1,opt,name=key,proto3" json:"key,omitempty"`
	Value int32 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Int64Int32) Descriptor deprecated added in v1.0.8

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

Deprecated: Use Int64Int32.ProtoReflect.Descriptor instead.

func (*Int64Int32) GetKey added in v1.0.8

func (x *Int64Int32) GetKey() int64

func (*Int64Int32) GetValue added in v1.0.8

func (x *Int64Int32) GetValue() int32

func (*Int64Int32) ProtoMessage added in v1.0.8

func (*Int64Int32) ProtoMessage()

func (*Int64Int32) ProtoReflect added in v1.0.8

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

func (*Int64Int32) Reset added in v1.0.8

func (x *Int64Int32) Reset()

func (*Int64Int32) String added in v1.0.8

func (x *Int64Int32) String() string

type Int64Int64 added in v1.0.8

type Int64Int64 struct {
	Key   int64 `protobuf:"varint,1,opt,name=key,proto3" json:"key,omitempty"`
	Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Int64Int64) Descriptor deprecated added in v1.0.8

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

Deprecated: Use Int64Int64.ProtoReflect.Descriptor instead.

func (*Int64Int64) GetKey added in v1.0.8

func (x *Int64Int64) GetKey() int64

func (*Int64Int64) GetValue added in v1.0.8

func (x *Int64Int64) GetValue() int64

func (*Int64Int64) ProtoMessage added in v1.0.8

func (*Int64Int64) ProtoMessage()

func (*Int64Int64) ProtoReflect added in v1.0.8

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

func (*Int64Int64) Reset added in v1.0.8

func (x *Int64Int64) Reset()

func (*Int64Int64) String added in v1.0.8

func (x *Int64Int64) String() string

type Int64List added in v1.0.8

type Int64List struct {
	List []int64 `protobuf:"varint,1,rep,packed,name=list,proto3" json:"list,omitempty"`
	// contains filtered or unexported fields
}

func (*Int64List) Descriptor deprecated added in v1.0.8

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

Deprecated: Use Int64List.ProtoReflect.Descriptor instead.

func (*Int64List) GetList added in v1.0.8

func (x *Int64List) GetList() []int64

func (*Int64List) ProtoMessage added in v1.0.8

func (*Int64List) ProtoMessage()

func (*Int64List) ProtoReflect added in v1.0.8

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

func (*Int64List) Reset added in v1.0.8

func (x *Int64List) Reset()

func (*Int64List) String added in v1.0.8

func (x *Int64List) String() string

type KickNotify added in v1.0.20

type KickNotify struct {
	ReasonCode    int32  `protobuf:"varint,1,opt,name=reason_code,json=reasonCode,proto3" json:"reason_code,omitempty"`
	Reason        string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
	Reconnectable bool   `protobuf:"varint,3,opt,name=reconnectable,proto3" json:"reconnectable,omitempty"`
	// contains filtered or unexported fields
}

KickNotify closes the connection and optionally permits client reconnection.

func (*KickNotify) Descriptor deprecated added in v1.0.20

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

Deprecated: Use KickNotify.ProtoReflect.Descriptor instead.

func (*KickNotify) GetReason added in v1.0.20

func (x *KickNotify) GetReason() string

func (*KickNotify) GetReasonCode added in v1.0.20

func (x *KickNotify) GetReasonCode() int32

func (*KickNotify) GetReconnectable added in v1.0.20

func (x *KickNotify) GetReconnectable() bool

func (*KickNotify) ProtoMessage added in v1.0.20

func (*KickNotify) ProtoMessage()

func (*KickNotify) ProtoReflect added in v1.0.20

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

func (*KickNotify) Reset added in v1.0.20

func (x *KickNotify) Reset()

func (*KickNotify) String added in v1.0.20

func (x *KickNotify) String() string

type Limits added in v1.0.20

type Limits struct {
	MaxPacketSize    int
	MaxBodySize      int
	MaxMetadataKeys  int
	MaxMetadataKey   int
	MaxMetadataValue int
	MaxMetadataSize  int
}

Limits bounds memory allocated while decoding one untrusted AGP packet.

func DefaultLimits added in v1.0.20

func DefaultLimits() Limits

DefaultLimits returns the server's default packet and metadata limits.

func NormalizeLimits added in v1.0.20

func NormalizeLimits(limits Limits) Limits

NormalizeLimits fills each unset field independently and keeps body limits within the packet limit. Transports and PacketCodec must share this result.

type Member

type Member struct {
	NodeID   string            `protobuf:"bytes,1,opt,name=nodeID,proto3" json:"nodeID,omitempty"`     // node id
	NodeType string            `protobuf:"bytes,2,opt,name=nodeType,proto3" json:"nodeType,omitempty"` // node type
	Address  string            `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"`   // rpc ip address
	Settings map[string]string ``                                                                      // node settings data
	/* 143-byte string literal not displayed */
	LastAt           int64 `protobuf:"varint,5,opt,name=lastAt,proto3" json:"lastAt,omitempty"`                     // last check time
	HeartbeatTimeout int64 `protobuf:"varint,6,opt,name=heartbeatTimeout,proto3" json:"heartbeatTimeout,omitempty"` // The heartbeat timeout period (in milliseconds) for custom node configuration
	// contains filtered or unexported fields
}

member data

func (*Member) Descriptor deprecated

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

Deprecated: Use Member.ProtoReflect.Descriptor instead.

func (*Member) GetAddress

func (x *Member) GetAddress() string

func (*Member) GetHeartbeatTimeout

func (x *Member) GetHeartbeatTimeout() int64

func (*Member) GetLastAt

func (x *Member) GetLastAt() int64

func (*Member) GetNodeID

func (x *Member) GetNodeID() string

func (*Member) GetNodeType

func (x *Member) GetNodeType() string

func (*Member) GetSettings

func (x *Member) GetSettings() map[string]string

func (*Member) IsTimeout

func (x *Member) IsTimeout(nowMills int64) bool

func (*Member) ProtoMessage

func (*Member) ProtoMessage()

func (*Member) ProtoReflect

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

func (*Member) Reset

func (x *Member) Reset()

func (*Member) String

func (x *Member) String() string

type MemberList

type MemberList struct {
	List []*Member `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
	// contains filtered or unexported fields
}

member list data

func (*MemberList) Descriptor deprecated

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

Deprecated: Use MemberList.ProtoReflect.Descriptor instead.

func (*MemberList) GetList

func (x *MemberList) GetList() []*Member

func (*MemberList) ProtoMessage

func (*MemberList) ProtoMessage()

func (*MemberList) ProtoReflect

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

func (*MemberList) Reset

func (x *MemberList) Reset()

func (*MemberList) String

func (x *MemberList) String() string

type MsgType added in v1.0.20

type MsgType int32

MsgType identifies the Actor operation carried between nodes.

const (
	MsgType_REQUEST  MsgType = 0
	MsgType_RESPONSE MsgType = 1
	MsgType_NOTIFY   MsgType = 2
)

func (MsgType) Descriptor added in v1.0.20

func (MsgType) Descriptor() protoreflect.EnumDescriptor

func (MsgType) Enum added in v1.0.20

func (x MsgType) Enum() *MsgType

func (MsgType) EnumDescriptor deprecated added in v1.0.20

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

Deprecated: Use MsgType.Descriptor instead.

func (MsgType) Number added in v1.0.20

func (x MsgType) Number() protoreflect.EnumNumber

func (MsgType) String added in v1.0.20

func (x MsgType) String() string

func (MsgType) Type added in v1.0.20

func (MsgType) Type() protoreflect.EnumType

type NodeID

type NodeID struct {
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*NodeID) Descriptor deprecated

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

Deprecated: Use NodeID.ProtoReflect.Descriptor instead.

func (*NodeID) GetValue

func (x *NodeID) GetValue() string

func (*NodeID) ProtoMessage

func (*NodeID) ProtoMessage()

func (*NodeID) ProtoReflect

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

func (*NodeID) Reset

func (x *NodeID) Reset()

func (*NodeID) String

func (x *NodeID) String() string

type None added in v1.0.8

type None struct {
	// contains filtered or unexported fields
}

func (*None) Descriptor deprecated added in v1.0.8

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

Deprecated: Use None.ProtoReflect.Descriptor instead.

func (*None) ProtoMessage added in v1.0.8

func (*None) ProtoMessage()

func (*None) ProtoReflect added in v1.0.8

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

func (*None) Reset added in v1.0.8

func (x *None) Reset()

func (*None) String added in v1.0.8

func (x *None) String() string

type Notify added in v1.0.20

type Notify struct {
	MethodId uint32 `protobuf:"varint,1,opt,name=method_id,json=methodId,proto3" json:"method_id,omitempty"`
	Body     []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

Notify is one-way and never receives a Response.

func (*Notify) Descriptor deprecated added in v1.0.20

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

Deprecated: Use Notify.ProtoReflect.Descriptor instead.

func (*Notify) GetBody added in v1.0.20

func (x *Notify) GetBody() []byte

func (*Notify) GetMethodId added in v1.0.20

func (x *Notify) GetMethodId() uint32

func (*Notify) ProtoMessage added in v1.0.20

func (*Notify) ProtoMessage()

func (*Notify) ProtoReflect added in v1.0.20

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

func (*Notify) Reset added in v1.0.20

func (x *Notify) Reset()

func (*Notify) String added in v1.0.20

func (x *Notify) String() string

type Packet added in v1.0.20

type Packet struct {

	// Types that are valid to be assigned to Kind:
	//
	//	*Packet_Request
	//	*Packet_Response
	//	*Packet_Notify
	Kind     isPacket_Kind     `protobuf_oneof:"kind"`
	Metadata map[string][]byte `` /* 143-byte string literal not displayed */
	Codec    int32             `protobuf:"varint,5,opt,name=codec,proto3" json:"codec,omitempty"`
	// contains filtered or unexported fields
}

Packet is the complete AGP application frame. The outer frame is always protobuf; codec selects only how Request/Response/Notify.body is encoded.

func (*Packet) Descriptor deprecated added in v1.0.20

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

Deprecated: Use Packet.ProtoReflect.Descriptor instead.

func (*Packet) GetCodec added in v1.0.20

func (x *Packet) GetCodec() int32

func (*Packet) GetKind added in v1.0.20

func (x *Packet) GetKind() isPacket_Kind

func (*Packet) GetMetadata added in v1.0.20

func (x *Packet) GetMetadata() map[string][]byte

func (*Packet) GetNotify added in v1.0.20

func (x *Packet) GetNotify() *Notify

func (*Packet) GetRequest added in v1.0.20

func (x *Packet) GetRequest() *Request

func (*Packet) GetResponse added in v1.0.20

func (x *Packet) GetResponse() *Response

func (*Packet) ProtoMessage added in v1.0.20

func (*Packet) ProtoMessage()

func (*Packet) ProtoReflect added in v1.0.20

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

func (*Packet) Reset added in v1.0.20

func (x *Packet) Reset()

func (*Packet) String added in v1.0.20

func (x *Packet) String() string

type PacketCodec added in v1.0.20

type PacketCodec struct {
	Limits Limits
}

PacketCodec validates and protobuf-encodes the AGP packet envelope.

func NewPacketCodec added in v1.0.20

func NewPacketCodec(limits Limits) *PacketCodec

NewPacketCodec creates a codec and applies DefaultLimits when limits are empty.

func (*PacketCodec) Decode added in v1.0.20

func (c *PacketCodec) Decode(data []byte) (*Packet, error)

Decode bounds input size, unmarshals protobuf and validates the result.

func (*PacketCodec) Encode added in v1.0.20

func (c *PacketCodec) Encode(packet *Packet) ([]byte, error)

Encode validates packet invariants before protobuf marshaling.

type Packet_Notify added in v1.0.20

type Packet_Notify struct {
	Notify *Notify `protobuf:"bytes,3,opt,name=notify,proto3,oneof"`
}

type Packet_Request added in v1.0.20

type Packet_Request struct {
	Request *Request `protobuf:"bytes,1,opt,name=request,proto3,oneof"`
}

type Packet_Response added in v1.0.20

type Packet_Response struct {
	Response *Response `protobuf:"bytes,2,opt,name=response,proto3,oneof"`
}

type Request added in v1.0.20

type Request struct {
	RequestId uint32 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	MethodId  uint32 `protobuf:"varint,2,opt,name=method_id,json=methodId,proto3" json:"method_id,omitempty"`
	TimeoutMs uint32 `protobuf:"varint,3,opt,name=timeout_ms,json=timeoutMs,proto3" json:"timeout_ms,omitempty"`
	Body      []byte `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

Request expects exactly one Response with the same request_id.

func (*Request) Descriptor deprecated added in v1.0.20

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetBody added in v1.0.20

func (x *Request) GetBody() []byte

func (*Request) GetMethodId added in v1.0.20

func (x *Request) GetMethodId() uint32

func (*Request) GetRequestId added in v1.0.20

func (x *Request) GetRequestId() uint32

func (*Request) GetTimeoutMs added in v1.0.20

func (x *Request) GetTimeoutMs() uint32

func (*Request) ProtoMessage added in v1.0.20

func (*Request) ProtoMessage()

func (*Request) ProtoReflect added in v1.0.20

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

func (*Request) Reset added in v1.0.20

func (x *Request) Reset()

func (*Request) String added in v1.0.20

func (x *Request) String() string

type Response

type Response struct {
	RequestId uint32 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	Code      int32  `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"`
	Message   string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	Body      []byte `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

Response carries transport status separately from the encoded business body.

func (*Response) Descriptor deprecated

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetBody added in v1.0.20

func (x *Response) GetBody() []byte

func (*Response) GetCode

func (x *Response) GetCode() int32

func (*Response) GetMessage added in v1.0.20

func (x *Response) GetMessage() string

func (*Response) GetRequestId added in v1.0.20

func (x *Response) GetRequestId() uint32

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type Session

type Session struct {
	Sid  string            `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"`  // session unique id
	Uid  int64             `protobuf:"varint,2,opt,name=uid,proto3" json:"uid,omitempty"` // user id
	Ip   string            `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"`    // ip address
	Data map[string]string ``                                                             // extend data
	/* 135-byte string literal not displayed */
	// contains filtered or unexported fields
}

Session contains connection/user state only. Request IDs never live here.

func (*Session) Clear

func (x *Session) Clear()

Clear releases all settings related to current sc

func (*Session) Contains

func (x *Session) Contains(key string) bool

func (*Session) Descriptor deprecated

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

Deprecated: Use Session.ProtoReflect.Descriptor instead.

func (*Session) Equal

func (x *Session) Equal(key, value string) bool

func (*Session) GetData

func (x *Session) GetData() map[string]string

func (*Session) GetInt

func (x *Session) GetInt(key string) int

func (*Session) GetInt32

func (x *Session) GetInt32(key string) int32

GetInt32 returns the value associated with the key as a int32.

func (*Session) GetInt64

func (x *Session) GetInt64(key string) int64

func (*Session) GetIp

func (x *Session) GetIp() string

func (*Session) GetSid

func (x *Session) GetSid() string

func (*Session) GetString

func (x *Session) GetString(key string) string

GetString returns the value associated with the key as a string.

func (*Session) GetUid

func (x *Session) GetUid() int64

func (*Session) GetUint

func (x *Session) GetUint(key string) uint

func (*Session) ImportAll

func (x *Session) ImportAll(data map[string]string)

func (*Session) IsBind

func (x *Session) IsBind() bool

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) ProtoReflect

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

func (*Session) Remove

func (x *Session) Remove(key string)

func (*Session) Reset

func (x *Session) Reset()

func (*Session) Restore

func (x *Session) Restore(data map[string]string)

func (*Session) Set

func (x *Session) Set(key string, value string)

func (*Session) SetAny added in v1.0.20

func (x *Session) SetAny(key string, value any)

func (*Session) String

func (x *Session) String() string

type StatusCode added in v1.0.20

type StatusCode int32

StatusCode is shared by AGP, HTTP Actor calls and cluster envelopes.

const (
	StatusCode_STATUS_OK                  StatusCode = 0
	StatusCode_STATUS_CANCELLED           StatusCode = 1
	StatusCode_STATUS_INVALID_ARGUMENT    StatusCode = 2
	StatusCode_STATUS_DEADLINE_EXCEEDED   StatusCode = 3
	StatusCode_STATUS_NOT_FOUND           StatusCode = 4
	StatusCode_STATUS_ALREADY_EXISTS      StatusCode = 5
	StatusCode_STATUS_PERMISSION_DENIED   StatusCode = 6
	StatusCode_STATUS_UNAUTHENTICATED     StatusCode = 7
	StatusCode_STATUS_RESOURCE_EXHAUSTED  StatusCode = 8
	StatusCode_STATUS_FAILED_PRECONDITION StatusCode = 9
	StatusCode_STATUS_ABORTED             StatusCode = 10
	StatusCode_STATUS_INTERNAL            StatusCode = 11
	StatusCode_STATUS_UNAVAILABLE         StatusCode = 12
	StatusCode_STATUS_UNSUPPORTED_MEDIA   StatusCode = 13
)

func (StatusCode) Descriptor added in v1.0.20

func (StatusCode) Descriptor() protoreflect.EnumDescriptor

func (StatusCode) Enum added in v1.0.20

func (x StatusCode) Enum() *StatusCode

func (StatusCode) EnumDescriptor deprecated added in v1.0.20

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

Deprecated: Use StatusCode.Descriptor instead.

func (StatusCode) Number added in v1.0.20

func (x StatusCode) Number() protoreflect.EnumNumber

func (StatusCode) String added in v1.0.20

func (x StatusCode) String() string

func (StatusCode) Type added in v1.0.20

type String added in v1.0.8

type String struct {
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*String) Descriptor deprecated added in v1.0.8

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

Deprecated: Use String.ProtoReflect.Descriptor instead.

func (*String) GetValue added in v1.0.8

func (x *String) GetValue() string

func (*String) ProtoMessage added in v1.0.8

func (*String) ProtoMessage()

func (*String) ProtoReflect added in v1.0.8

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

func (*String) Reset added in v1.0.8

func (x *String) Reset()

func (*String) String added in v1.0.8

func (x *String) String() string

type StringKeyValue added in v1.0.8

type StringKeyValue struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*StringKeyValue) Descriptor deprecated added in v1.0.8

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

Deprecated: Use StringKeyValue.ProtoReflect.Descriptor instead.

func (*StringKeyValue) GetKey added in v1.0.8

func (x *StringKeyValue) GetKey() string

func (*StringKeyValue) GetValue added in v1.0.8

func (x *StringKeyValue) GetValue() string

func (*StringKeyValue) ProtoMessage added in v1.0.8

func (*StringKeyValue) ProtoMessage()

func (*StringKeyValue) ProtoReflect added in v1.0.8

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

func (*StringKeyValue) Reset added in v1.0.8

func (x *StringKeyValue) Reset()

func (*StringKeyValue) String added in v1.0.8

func (x *StringKeyValue) String() string

Jump to

Keyboard shortcuts

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