Documentation
¶
Index ¶
- Constants
- Variables
- func NewResponser(sendFunc life.SendFunc) life.Responsive
- func SendFunc(stream intrav1.TunnelService_TunnelServer, p xnet.TunnelMessage) error
- type Context
- type Manager
- func (m *Manager) ExecuteEvent(ctx context.Context, uid int64, f life.EventFunc) (err error)
- func (m *Manager) RegisterEvent(et life.WorkerEventType, f eventFunc)
- func (m *Manager) RegisterMinuteTick(f func(ctx Context) error)
- func (m *Manager) RegisterOnCreatedEvent(f func(ctx Context) error)
- func (m *Manager) RegisterOnLoadEvent(f func(ctx Context) error)
- func (m *Manager) RegisterSecondTick(f func(ctx Context) error)
- type UserPersister
- func (s *UserPersister) AllModuleKeys() []life.ModuleKey
- func (s *UserPersister) ID() int64
- func (s *UserPersister) IncVersion(ctx context.Context, uid int64) (err error)
- func (s *UserPersister) Lock(f func() error) error
- func (s *UserPersister) OnStop(ctx context.Context, id int64, p life.VersionProto) (err error)
- func (s *UserPersister) Persist(ctx context.Context, uid int64, proto life.VersionProto) (err error)
- func (s *UserPersister) PrepareToPersist(ctx context.Context, modules []life.ModuleKey) (ret life.VersionProto, err error)
- func (s *UserPersister) Refresh(ctx context.Context) (err error)
- func (s *UserPersister) Snapshot() life.VersionProto
- func (s *UserPersister) UnsafeObject() any
- func (s *UserPersister) Version() int64
Constants ¶
View Source
const ( EventStorageItemUpdated = life.WorkerEventType(iota + 1) // storage updated. args: item IDs EventStoragePackUpdated // storage updated. args: pack IDs WorkerEventTypeHeroUpdated // hero updated. args: none WorkerEventTypeEffectParamUpdated // effect param updated. args: none )
Variables ¶
View Source
var ( ArgKeyStorageItemIDs = argKeyStorageItemIDs{} ArgKeyStoragePackIDs = argKeyStoragePackIDs{} ArgKeyHeroIDs = argKeyHeroIDs{} ArgKeyEffectParamIDs = argKeyEffectParamIDs{} )
View Source
var ProviderSet = wire.NewSet(NewManager, data.ProviderSet)
Functions ¶
func NewResponser ¶
func NewResponser(sendFunc life.SendFunc) life.Responsive
func SendFunc ¶
func SendFunc(stream intrav1.TunnelService_TunnelServer, p xnet.TunnelMessage) error
Types ¶
type Manager ¶
func NewManager ¶
func NewManager(logger log.Logger, rt *self.SelfRouteTable, userDo *domain.UserDomain, pusher *data.PushRepo) (*Manager, func())
func (*Manager) ExecuteEvent ¶
func (*Manager) RegisterEvent ¶
func (m *Manager) RegisterEvent(et life.WorkerEventType, f eventFunc)
func (*Manager) RegisterMinuteTick ¶
func (*Manager) RegisterOnCreatedEvent ¶
func (*Manager) RegisterOnLoadEvent ¶
func (*Manager) RegisterSecondTick ¶
type UserPersister ¶
type UserPersister struct {
// contains filtered or unexported fields
}
func (*UserPersister) AllModuleKeys ¶
func (s *UserPersister) AllModuleKeys() []life.ModuleKey
func (*UserPersister) ID ¶
func (s *UserPersister) ID() int64
func (*UserPersister) IncVersion ¶
func (s *UserPersister) IncVersion(ctx context.Context, uid int64) (err error)
func (*UserPersister) Lock ¶
func (s *UserPersister) Lock(f func() error) error
func (*UserPersister) OnStop ¶
func (s *UserPersister) OnStop(ctx context.Context, id int64, p life.VersionProto) (err error)
func (*UserPersister) Persist ¶
func (s *UserPersister) Persist(ctx context.Context, uid int64, proto life.VersionProto) (err error)
func (*UserPersister) PrepareToPersist ¶
func (s *UserPersister) PrepareToPersist(ctx context.Context, modules []life.ModuleKey) (ret life.VersionProto, err error)
func (*UserPersister) Snapshot ¶
func (s *UserPersister) Snapshot() life.VersionProto
func (*UserPersister) UnsafeObject ¶
func (s *UserPersister) UnsafeObject() any
func (*UserPersister) Version ¶
func (s *UserPersister) Version() int64
Click to show internal directories.
Click to hide internal directories.