Versions in this module Expand all Collapse all v2 v2.7.1 Jan 15, 2024 v2.7.0 Jan 12, 2024 Changes in this version + func AddGRPCInfoToMetadata(metadata map[string]string, region string, host, port string, ...) map[string]string + func AddMetricTagsToPropagateCtx(ctx context.Context, tags map[string]string) context.Context + func AddRoute(serverType string, routingFunction router.RoutingFunc) error + func AddToPropagateCtx(ctx context.Context, key string, val interface{}) context.Context + func Configure(isFrontend bool, serverType string, serverMode ServerMode, ...) + func CreatePrometheusReporter(serverType string, config config.PrometheusConfig, ...) (*metrics.PrometheusReporter, error) + func CreateStatsdReporter(serverType string, config config.StatsdConfig) (*metrics.StatsdReporter, error) + func Descriptor(protoName string) ([]byte, error) + func Documentation(getPtrNames bool) (map[string]interface{}, error) + func Error(err error, code string, metadata ...map[string]string) *errors.Error + func ExtractSpan(ctx context.Context) (opentracing.SpanContext, error) + func GetDefaultLoggerFromCtx(ctx context.Context) logging.Logger + func GetDieChan() chan bool + func GetFromPropagateCtx(ctx context.Context, key string) interface + func GetMetricsReporters() []metrics.Reporter + func GetModule(name string) (interfaces.Module, error) + func GetServer() *cluster.Server + func GetServerByID(id string) (*cluster.Server, error) + func GetServerID() string + func GetServers() []*cluster.Server + func GetServersByType(t string) (map[string]*cluster.Server, error) + func GetSessionFromCtx(ctx context.Context) session.Session + func GroupAddMember(ctx context.Context, groupName, uid string) error + func GroupBroadcast(ctx context.Context, frontendType, groupName, route string, v interface{}) error + func GroupContainsMember(ctx context.Context, groupName, uid string) (bool, error) + func GroupCountMembers(ctx context.Context, groupName string) (int, error) + func GroupCreate(ctx context.Context, groupName string) error + func GroupCreateWithTTL(ctx context.Context, groupName string, ttlTime time.Duration) error + func GroupDelete(ctx context.Context, groupName string) error + func GroupMembers(ctx context.Context, groupName string) ([]string, error) + func GroupRemoveAll(ctx context.Context, groupName string) error + func GroupRemoveMember(ctx context.Context, groupName, uid string) error + func GroupRenewTTL(ctx context.Context, groupName string) error + func IsRunning() bool + func NewAfterTimer(duration time.Duration, fn timer.Func) *timer.Timer + func NewCondTimer(condition timer.Condition, fn timer.Func) (*timer.Timer, error) + func NewCountTimer(interval time.Duration, count int, fn timer.Func) *timer.Timer + func NewTimer(interval time.Duration, fn timer.Func) *timer.Timer + func RPC(ctx context.Context, routeStr string, reply proto.Message, arg proto.Message) error + func RPCTo(ctx context.Context, serverID, routeStr string, reply proto.Message, ...) error + func Register(c component.Component, options ...component.Option) + func RegisterModule(module interfaces.Module, name string) error + func RegisterModuleAfter(module interfaces.Module, name string) error + func RegisterModuleBefore(module interfaces.Module, name string) error + func RegisterRPCJob(rpcJob worker.RPCJob) error + func RegisterRemote(c component.Component, options ...component.Option) + func ReliableRPC(routeStr string, metadata map[string]interface{}, reply, arg proto.Message) (jid string, err error) + func ReliableRPCWithOptions(routeStr string, metadata map[string]interface{}, reply, arg proto.Message, ...) (jid string, err error) + func SendKickToUsers(uids []string, frontendType string) ([]string, error) + func SendPushToUsers(route string, v interface{}, uids []string, frontendType string) ([]string, error) + func SetDebug(debug bool) + func SetDictionary(dict map[string]uint16) error + func SetHeartbeatTime(interval time.Duration) + func SetLogger(l logging.Logger) + func SetTimerBacklog(c int) + func SetTimerPrecision(precision time.Duration) + func Shutdown() + func Start() + func StartWorker() + type App struct + func NewApp(serverMode ServerMode, serializer serialize.Serializer, ...) *App + func (app *App) AddRoute(serverType string, routingFunction router.RoutingFunc) error + func (app *App) Documentation(getPtrNames bool) (map[string]interface{}, error) + func (app *App) GetDieChan() chan bool + func (app *App) GetMetricsReporters() []metrics.Reporter + func (app *App) GetModule(name string) (interfaces.Module, error) + func (app *App) GetServer() *cluster.Server + func (app *App) GetServerByID(id string) (*cluster.Server, error) + func (app *App) GetServerID() string + func (app *App) GetServers() []*cluster.Server + func (app *App) GetServersByType(t string) (map[string]*cluster.Server, error) + func (app *App) GetSessionFromCtx(ctx context.Context) session.Session + func (app *App) GroupAddMember(ctx context.Context, groupName, uid string) error + func (app *App) GroupBroadcast(ctx context.Context, frontendType, groupName, route string, v interface{}) error + func (app *App) GroupContainsMember(ctx context.Context, groupName, uid string) (bool, error) + func (app *App) GroupCountMembers(ctx context.Context, groupName string) (int, error) + func (app *App) GroupCreate(ctx context.Context, groupName string) error + func (app *App) GroupCreateWithTTL(ctx context.Context, groupName string, ttlTime time.Duration) error + func (app *App) GroupDelete(ctx context.Context, groupName string) error + func (app *App) GroupMembers(ctx context.Context, groupName string) ([]string, error) + func (app *App) GroupRemoveAll(ctx context.Context, groupName string) error + func (app *App) GroupRemoveMember(ctx context.Context, groupName, uid string) error + func (app *App) GroupRenewTTL(ctx context.Context, groupName string) error + func (app *App) IsRunning() bool + func (app *App) RPC(ctx context.Context, routeStr string, reply proto.Message, arg proto.Message) error + func (app *App) RPCTo(ctx context.Context, serverID, routeStr string, reply proto.Message, ...) error + func (app *App) Register(c component.Component, options ...component.Option) + func (app *App) RegisterModule(module interfaces.Module, name string) error + func (app *App) RegisterModuleAfter(module interfaces.Module, name string) error + func (app *App) RegisterModuleBefore(module interfaces.Module, name string) error + func (app *App) RegisterRPCJob(rpcJob worker.RPCJob) error + func (app *App) RegisterRemote(c component.Component, options ...component.Option) + func (app *App) ReliableRPC(routeStr string, metadata map[string]interface{}, reply, arg proto.Message) (jid string, err error) + func (app *App) ReliableRPCWithOptions(routeStr string, metadata map[string]interface{}, reply, arg proto.Message, ...) (jid string, err error) + func (app *App) SendKickToUsers(uids []string, frontendType string) ([]string, error) + func (app *App) SendPushToUsers(route string, v interface{}, uids []string, frontendType string) ([]string, error) + func (app *App) SetDebug(debug bool) + func (app *App) SetDictionary(dict map[string]uint16) error + func (app *App) SetHeartbeatTime(interval time.Duration) + func (app *App) Shutdown() + func (app *App) Start() + func (app *App) StartWorker() + type Builder struct + Config config.BuilderConfig + DieChan chan bool + Groups groups.GroupService + HandlerHooks *pipeline.HandlerHooks + MessageEncoder *message.MessagesEncoder + MetricsReporters []metrics.Reporter + PacketDecoder codec.PacketDecoder + PacketEncoder codec.PacketEncoder + RPCClient cluster.RPCClient + RPCServer cluster.RPCServer + Router *router.Router + Serializer serialize.Serializer + Server *cluster.Server + ServerMode ServerMode + ServiceDiscovery cluster.ServiceDiscovery + SessionPool session.SessionPool + Worker *worker.Worker + func NewBuilder(isFrontend bool, serverType string, serverMode ServerMode, ...) *Builder + func NewBuilderWithConfigs(isFrontend bool, serverType string, serverMode ServerMode, ...) *Builder + func NewDefaultBuilder(isFrontend bool, serverType string, serverMode ServerMode, ...) *Builder + func (builder *Builder) AddAcceptor(ac acceptor.Acceptor) + func (builder *Builder) AddPostBuildHook(hook func(app Pitaya)) + func (builder *Builder) Build() Pitaya + type Pitaya interface + AddRoute func(serverType string, routingFunction router.RoutingFunc) error + Documentation func(getPtrNames bool) (map[string]interface{}, error) + GetDieChan func() chan bool + GetMetricsReporters func() []metrics.Reporter + GetModule func(name string) (interfaces.Module, error) + GetServer func() *cluster.Server + GetServerByID func(id string) (*cluster.Server, error) + GetServerID func() string + GetServers func() []*cluster.Server + GetServersByType func(t string) (map[string]*cluster.Server, error) + GetSessionFromCtx func(ctx context.Context) session.Session + GroupAddMember func(ctx context.Context, groupName, uid string) error + GroupBroadcast func(ctx context.Context, frontendType, groupName, route string, v interface{}) error + GroupContainsMember func(ctx context.Context, groupName, uid string) (bool, error) + GroupCountMembers func(ctx context.Context, groupName string) (int, error) + GroupCreate func(ctx context.Context, groupName string) error + GroupCreateWithTTL func(ctx context.Context, groupName string, ttlTime time.Duration) error + GroupDelete func(ctx context.Context, groupName string) error + GroupMembers func(ctx context.Context, groupName string) ([]string, error) + GroupRemoveAll func(ctx context.Context, groupName string) error + GroupRemoveMember func(ctx context.Context, groupName, uid string) error + GroupRenewTTL func(ctx context.Context, groupName string) error + IsRunning func() bool + RPC func(ctx context.Context, routeStr string, reply proto.Message, arg proto.Message) error + RPCTo func(ctx context.Context, serverID, routeStr string, reply proto.Message, ...) error + Register func(c component.Component, options ...component.Option) + RegisterModule func(module interfaces.Module, name string) error + RegisterModuleAfter func(module interfaces.Module, name string) error + RegisterModuleBefore func(module interfaces.Module, name string) error + RegisterRPCJob func(rpcJob worker.RPCJob) error + RegisterRemote func(c component.Component, options ...component.Option) + ReliableRPC func(routeStr string, metadata map[string]interface{}, reply, arg proto.Message) (jid string, err error) + ReliableRPCWithOptions func(routeStr string, metadata map[string]interface{}, reply, arg proto.Message, ...) (jid string, err error) + SendKickToUsers func(uids []string, frontendType string) ([]string, error) + SendPushToUsers func(route string, v interface{}, uids []string, frontendType string) ([]string, error) + SetDebug func(debug bool) + SetDictionary func(dict map[string]uint16) error + SetHeartbeatTime func(interval time.Duration) + Shutdown func() + Start func() + StartWorker func() + var DefaultApp Pitaya + func NewDefaultApp(isFrontend bool, serverType string, serverMode ServerMode, ...) Pitaya + type PitayaBuilder interface + AddPostBuildHook func(hook func(app Pitaya)) + Build func() Pitaya + type ServerMode byte + const Cluster + const Standalone