2018-06-10 08:44:53 +02:00
|
|
|
package base
|
|
|
|
|
|
|
|
// Context stores dynamic values like channels and exposes configuration
|
|
|
|
type Context struct {
|
2018-07-08 23:48:48 +02:00
|
|
|
Sessions chan *Session
|
2018-06-10 08:44:53 +02:00
|
|
|
Done chan bool
|
|
|
|
Config *Config
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewContext instanciates a Context
|
2018-07-08 23:48:48 +02:00
|
|
|
func NewContext(config *Config, sessions chan *Session, done chan bool) *Context {
|
2018-06-10 08:44:53 +02:00
|
|
|
return &Context{
|
|
|
|
Config: config,
|
|
|
|
Sessions: sessions,
|
|
|
|
Done: done,
|
|
|
|
}
|
|
|
|
}
|