modules

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIDocsGen added in v0.7.6

type APIDocsGen struct {
	Base
	// contains filtered or unexported fields
}

APIDocsGen is a pitaya module that generates api docs for pitaya servers

func NewAPIDocsGen added in v0.7.6

func NewAPIDocsGen(basePath string, services []*component.Service) *APIDocsGen

NewAPIDocsGen creates a new APIDocsGen

func (*APIDocsGen) Init added in v0.7.6

func (a *APIDocsGen) Init() error

Init is called on init method

type Base added in v0.7.6

type Base struct{}

Base implements a default component for Component.

func (*Base) AfterInit added in v0.7.6

func (c *Base) AfterInit()

AfterInit was called after the component is initialized.

func (*Base) BeforeShutdown added in v0.7.6

func (c *Base) BeforeShutdown()

BeforeShutdown was called before the component to shutdown.

func (*Base) Init added in v0.7.6

func (c *Base) Init() error

Init was called to initialize the component.

func (*Base) Shutdown added in v0.7.6

func (c *Base) Shutdown() error

Shutdown was called to shutdown the component.

type Binary

type Binary struct {
	Base
	// 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) 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 {
	Base
	// 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) 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 {
	Base
	// 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) 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

Jump to

Keyboard shortcuts

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