Documentation ¶
Index ¶
- type Binary
- type ETCDBindingStorage
- func (b *ETCDBindingStorage) AfterInit()
- func (b *ETCDBindingStorage) BeforeShutdown()
- func (b *ETCDBindingStorage) GetUserFrontendID(uid, frontendType string) (string, error)
- func (b *ETCDBindingStorage) Init() error
- func (b *ETCDBindingStorage) PutBinding(uid string) error
- func (b *ETCDBindingStorage) Shutdown() error
- type UniqueSession
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Binary ¶
type Binary struct {
// contains filtered or unexported fields
}
Binary is a pitaya module that starts a binary as a child process and pipes its stdout
func (*Binary) BeforeShutdown ¶
func (b *Binary) BeforeShutdown()
BeforeShutdown runs tasks before shutting down the binary module
func (*Binary) GetExitChannel ¶
func (b *Binary) GetExitChannel() chan struct{}
GetExitChannel gets a channel that is closed when the binary dies
type ETCDBindingStorage ¶
type ETCDBindingStorage struct {
// contains filtered or unexported fields
}
ETCDBindingStorage module that uses etcd to keep in which frontend server each user is bound
func NewETCDBindingStorage ¶
func NewETCDBindingStorage(server *cluster.Server, conf *config.Config) *ETCDBindingStorage
NewETCDBindingStorage returns a new instance of BindingStorage
func (*ETCDBindingStorage) AfterInit ¶
func (b *ETCDBindingStorage) AfterInit()
AfterInit executes after Init
func (*ETCDBindingStorage) BeforeShutdown ¶
func (b *ETCDBindingStorage) BeforeShutdown()
BeforeShutdown executes before shutting down
func (*ETCDBindingStorage) GetUserFrontendID ¶
func (b *ETCDBindingStorage) GetUserFrontendID(uid, frontendType string) (string, error)
GetUserFrontendID gets the id of the frontend server a user is connected to TODO: should we set context here? TODO: this could be way more optimized, using watcher and local caching
func (*ETCDBindingStorage) Init ¶
func (b *ETCDBindingStorage) Init() error
Init starts the binding storage module
func (*ETCDBindingStorage) PutBinding ¶
func (b *ETCDBindingStorage) PutBinding(uid string) error
PutBinding puts the binding info into etcd
func (*ETCDBindingStorage) Shutdown ¶
func (b *ETCDBindingStorage) Shutdown() error
Shutdown executes on shutdown and will clean etcd
type UniqueSession ¶
type UniqueSession struct {
// contains filtered or unexported fields
}
UniqueSession module watches for sessions using the same UID and kicks them
func NewUniqueSession ¶
func NewUniqueSession(server *cluster.Server, rpcServer cluster.RPCServer, rpcClient cluster.RPCClient) *UniqueSession
NewUniqueSession creates a new unique session module
func (*UniqueSession) AfterInit ¶
func (u *UniqueSession) AfterInit()
AfterInit runs after initialization tasks
func (*UniqueSession) BeforeShutdown ¶
func (u *UniqueSession) BeforeShutdown()
BeforeShutdown runs tasks before shutting down the binary module
func (*UniqueSession) OnUserBind ¶
func (u *UniqueSession) OnUserBind(uid, fid string)
OnUserBind method should be called when a user binds a session in remote servers
func (*UniqueSession) Shutdown ¶
func (u *UniqueSession) Shutdown() error
Shutdown shutdowns the binary module