MCPcopy Create free account

hub / github.com/bytemode/pitaya-notes / functions

Functions1,948 in github.com/bytemode/pitaya-notes

↓ 11 callersFunctionmemberKey
(groupName, uid string)
groups/etcd_group_service.go:71
↓ 10 callersMethodCall
(ctx context.Context, in *Request, opts ...grpc.CallOption)
protos/pitaya.pb.go:38
↓ 10 callersMethodEXPECT
EXPECT returns an object that allows the caller to indicate expected use
worker/mocks/rpc_job.go:33
↓ 10 callersMethodEXPECT
EXPECT returns an object that allows the caller to indicate expected use
cluster/mocks/cluster.go:114
↓ 10 callersFunctionGetMetricsReporters
GetMetricsReporters gets registered metrics reporters
app.go:241
↓ 10 callersFunctionNewError
NewError ctor
errors/errors.go:47
↓ 10 callersFunctionNewMockReporter
NewMockReporter creates a new mock instance
metrics/mocks/reporter.go:25
↓ 10 callersFunctionNewService
NewService creates a new service
component/service.go:66
↓ 10 callersMethodWrite
Write mocks base method
mocks/net.go:99
↓ 10 callersMethodshouldRateLimit
shouldRateLimit saves the now as time taken or returns an error if in the limit of rate limiting
acceptorwrapper/rate_limiter.go:94
↓ 9 callersMethodGetBool
GetBool returns an boolean from the inner config
config/config.go:148
↓ 9 callersMethodGetServersByType
(serverType string)
cluster/service_discovery.go:29
↓ 9 callersFunctionNewPomeloPacketDecoder
NewPomeloPacketDecoder returns a new decoder that used for decode network bytes slice.
conn/codec/pomelo_packet_decoder.go:35
↓ 9 callersFunctionNewRemote
NewRemote create new Remote instance
agent/agent_remote.go:58
↓ 9 callersFunctionNewTimer
NewTimer creates a cron job
timer/timer.go:97
↓ 9 callersMethodPushBack
PushBack should not be used after pitaya is running
pipeline/pipeline.go:59
↓ 9 callersFunctionShutdown
Shutdown send a signal to let 'pitaya' shutdown itself.
app.go:539
↓ 9 callersMethodStop
Stop stops the acceptor
acceptor/ws_acceptor.go:161
↓ 9 callersMethodString
()
examples/demo/cluster_protobuf/protos/cluster.pb.go:163
↓ 9 callersMethodValue
Value returns the value associated with the key as a interface{}.
session/session.go:628
↓ 9 callersFunctiongetChannel
(serverType, serverID string)
cluster/nats_rpc_common.go:30
↓ 9 callersFunctiongetClients
(n, port int)
benchmark/benchmark_test.go:34
↓ 8 callersFunctionExtractSpan
ExtractSpan retrieves an opentracing span context from the given context.Context The span context can be received directly (inside the context) or via
tracing/span.go:53
↓ 8 callersMethodGetAddr
GetAddr returns the addr the acceptor will listen on
acceptor/tcp_acceptor.go:62
↓ 8 callersMethodGetConnChan
GetConnChan gets a connection channel
acceptor/ws_acceptor.go:73
↓ 8 callersFunctionGetDefaultLoggerFromCtx
GetDefaultLoggerFromCtx returns the default logger from the given context
app.go:564
↓ 8 callersFunctionGetUserKickTopic
GetUserKickTopic get the topic for kicking an user
cluster/nats_rpc_server.go:120
↓ 8 callersMethodGroupContainsMember
(ctx context.Context, groupName, uid string)
groups/group_service.go:12
↓ 8 callersMethodOnClose
OnClose adds the function it receives to the callbacks that will be called when the session is closed
session/session.go:333
↓ 8 callersMethodPushFront
PushFront should not be used after pitaya is running
pipeline/pipeline.go:51
↓ 8 callersFunctionRegisterModule
RegisterModule registers a module, by default it register after registered modules
module.go:43
↓ 8 callersFunctionSerializeOrRaw
SerializeOrRaw serializes the interface if its not an array of bytes already
util/util.go:105
↓ 8 callersMethodSetData
SetData sets the whole session data
session/session.go:247
↓ 8 callersMethodStop
()
acceptor/acceptor.go:31
↓ 8 callersMethodbootstrapServer
bootstrapServer 启动服务
cluster/etcd_service_discovery.go:226
↓ 8 callersMethodgrantLease
grantLease创建租约并且续租同时监听续租的相应管道
cluster/etcd_service_discovery.go:191
↓ 8 callersFunctionmustConnectToWS
(t *testing.T, write []byte, w *WSAcceptor, protocol string)
acceptor/ws_acceptor_test.go:78
↓ 7 callersMethodClear
Clear releases all data related to current session
session/session.go:648
↓ 7 callersFunctionDecode
Decode decodes the route
route/route.go:65
↓ 7 callersFunctionGetServer
GetServer gets the local server instance
app.go:272
↓ 7 callersMethodGetStatus
GetStatus gets the status
agent/agent.go:242
↓ 7 callersFunctionGetUserMessagesTopic
GetUserMessagesTopic get the topic for user
cluster/nats_rpc_server.go:115
↓ 7 callersFunctionGroupContainsMember
GroupContainsMember checks whether an UID is contained in group or not
group.go:84
↓ 7 callersFunctionGroupCountMembers
GroupCountMembers get current member amount in group
group.go:112
↓ 7 callersMethodInit
Init inits nats rpc client
cluster/nats_rpc_client.go:204
↓ 7 callersMethodListenAndServe
ListenAndServe listens and serve in the specified addr
acceptor/ws_acceptor.go:104
↓ 7 callersFunctionNewEtcdServiceDiscovery
NewEtcdServiceDiscovery ctor
cluster/etcd_service_discovery.go:80
↓ 7 callersFunctionNewGRPCServer
NewGRPCServer constructor
cluster/grpc_rpc_server.go:44
↓ 7 callersFunctionNewStatsdReporter
NewStatsdReporter returns an instance of statsd reportar and an error if something fails
metrics/statsd_reporter.go:48
↓ 7 callersMethodPushToUser
(ctx context.Context, in *Push, opts ...grpc.CallOption)
protos/pitaya.pb.go:39
↓ 7 callersMethodRegister
Register registers components
service/remote.go:244
↓ 7 callersMethodSetStatus
SetStatus sets the agent status
agent/agent.go:263
↓ 7 callersFunctionStartSpan
StartSpan starts a new span with a given parent context, operation name, tags and optional parent span. It returns a context with the created span.
tracing/span.go:95
↓ 7 callersMethodString
()
conn/message/message.go:179
↓ 7 callersFunctionWriteFile
WriteFile test helper
helpers/helpers.go:73
↓ 7 callersFunctioncopyArray
(dest, doffset, src, soffset, length)
examples/demo/chat/web/protocol.js:263
↓ 7 callersFunctiongetRPCClient
(c *config.Config)
cluster/grpc_rpc_client_test.go:25
↓ 6 callersFunctionAddTimer
AddTimer adds a timer to the manager
timer/timer.go:87
↓ 6 callersMethodClose
Close closes the agent, cleans inner state and closes low-level connection. Any blocked Read or Write operations will be unblocked and return errors.
agent/agent.go:203
↓ 6 callersMethodEXPECT
EXPECT returns an object that allows the caller to indicate expected use
conn/codec/mocks/packet_encoder.go:32
↓ 6 callersMethodEXPECT
EXPECT returns an object that allows the caller to indicate expected use
cluster/mocks/service_discovery.go:32
↓ 6 callersMethodGetArgReply
GetArgReply returns the arg and reply of the method
worker/rpc_job.go:49
↓ 6 callersMethodGetDataEncoded
GetDataEncoded returns the session data as an encoded value
session/session.go:256
↓ 6 callersMethodGetUserFrontendID
(uid, frontendType string)
interfaces/interfaces.go:33
↓ 6 callersFunctionGroupMembers
GroupMembers returns all member's UIDs
group.go:59
↓ 6 callersMethodInfo
(args ...interface{})
logger/logger.go:41
↓ 6 callersFunctionInitGroups
InitGroups should be called once at the beginning of the application to setup the service type that will manage the groups
group.go:42
↓ 6 callersMethodKickUser
(ctx context.Context, in *KickMsg, opts ...grpc.CallOption)
protos/pitaya.pb.go:41
↓ 6 callersFunctionNewMemoryGroupService
NewMemoryGroupService returns a new group instance
groups/memory_group_service.go:30
↓ 6 callersFunctionNewMockSerializer
NewMockSerializer creates a new mock instance
serialize/mocks/serializer.go:24
↓ 6 callersFunctionRegisterModuleBefore
RegisterModuleBefore registers a module before all registered modules
module.go:63
↓ 6 callersMethodResponseMID
(ctx context.Context, mid uint, v interface{}, isError ...bool)
session/session.go:42
↓ 6 callersMethodSendPush
(userID string, frontendSv *Server, push *protos.Push)
cluster/cluster.go:46
↓ 6 callersFunctionSendPushToUsers
SendPushToUsers sends a message to the given list of users SendPushToUsers 发送一个消息到所有的用户 通过session或者rcp调用主要依赖本地server是否制定的frontendType
push.go:34
↓ 6 callersMethodSessionBindRemote
(ctx context.Context, in *BindMsg, opts ...grpc.CallOption)
protos/pitaya.pb.go:40
↓ 6 callersFunctiongetKey
getKey 类型和id组装成key servers/serverType/serverID
cluster/etcd_service_discovery.go:290
↓ 5 callersFunctionAddRoute
AddRoute adds a routing function to a server type AddRoute 添加路由策略到路由其中
app.go:523
↓ 5 callersMethodAnswerWithError
AnswerWithError answers with an error
agent/agent.go:436
↓ 5 callersMethodBindSession
BindSession binds the local session
remote/sys.go:38
↓ 5 callersFunctionCron
Cron executes scheduled tasks TODO: if closing Timers'count in single cron call more than timerBacklog will case problem.
timer/timer.go:147
↓ 5 callersMethodEXPECT
EXPECT returns an object that allows the caller to indicate expected use
protos/mocks/pitaya.go:34
↓ 5 callersMethodEncode
message编码方式 消息头 ----------flag(1byte) --------------------------------------------------->message id(0~5byte)------>route(0~256byte) preserved(3bit) +
conn/message/message_encoder.go:71
↓ 5 callersMethodExtractHandler
ExtractHandler extract the set of methods from the receiver value which satisfy the following conditions: - exported method of exported type - one or
component/service.go:97
↓ 5 callersMethodExtractRemote
ExtractRemote extract the set of methods from the receiver value which satisfy the following conditions: - exported method of exported type - two retu
component/service.go:135
↓ 5 callersMethodGetData
()
protos/msg.pb.go:99
↓ 5 callersMethodGetName
()
serialize/serializer.go:41
↓ 5 callersMethodGetRoute
()
protos/msg.pb.go:92
↓ 5 callersMethodHandle
Handle handles the messages from and to a client
agent/agent.go:268
↓ 5 callersMethodInit
Init inits nats rpc server
cluster/nats_rpc_server.go:313
↓ 5 callersMethodListenAndServe
()
acceptor/acceptor.go:30
↓ 5 callersFunctionNewSerializer
NewSerializer returns a new Serializer.
serialize/protobuf/protobuf.go:32
↓ 5 callersFunctionNewTimer
NewTimer returns a new Timer containing a function that will be called with a period specified by the duration argument. It adjusts the intervals for
timer.go:36
↓ 5 callersMethodSend
Send publishes a message in a given topic
cluster/nats_rpc_client.go:104
↓ 5 callersFunctionSetDictionary
启用路由压缩 对于服务端,server会扫描所有的Handler信息 对于客户端,用户需要配置一个路由映射表 通过这两种方式,pitaya会拿到所有的客户端和服务端的路由信息,然后将每一个路由信息都映射为一个小整数, 在客户端与服务器建立连接的握手过程中,服务器会将 整个字典传给客户端, 这样在以后
conn/message/message.go:149
↓ 5 callersFunctionStartWorker
StartWorker configures, starts and returns pitaya worker
app.go:637
↓ 5 callersFunctionToMap
ToMap returns the values that will be propagated through RPC calls in map[string]interface{} format
context/context.go:73
↓ 5 callersMethodconnect
--------------------grpcClient-------------------------------- connect连接指定server上的grpc server
cluster/grpc_rpc_client.go:318
↓ 5 callersFunctionprocessHandlerMessage
根据Route查找component.Handler利用反射机制调用handler,同时将消息和ctx作为参数
service/util.go:140
↓ 5 callersMethodprocessPacket
(a *agent.Agent, p *packet.Packet)
service/handler.go:224
↓ 5 callersMethodupdateEncodedData
()
session/session.go:207
← previousnext →101–200 of 1,948, ranked by callers