modules

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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 NewBinary

func NewBinary(binPath string, args []string, gracefulShutdownInterval ...time.Duration) *Binary

NewBinary creates a new binary module with the given path

func (*Binary) AfterInit

func (b *Binary) AfterInit()

AfterInit runs after initialization tasks

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

func (*Binary) Init

func (b *Binary) Init() error

Init initializes the binary

func (*Binary) Shutdown

func (b *Binary) Shutdown() error

Shutdown shutdowns the binary module

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) Init

func (u *UniqueSession) Init() error

Init initializes the 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

Jump to

Keyboard shortcuts

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