Documentation ¶
Index ¶
- type Bandwidth
- type Config
- type NoopBandwidth
- type Server
- func (s *Server) AddChannel(name string, c channel.Channel) error
- func (s *Server) Broadcast(f channel.ClientFilter, m channel.Msg) error
- func (s *Server) BroadcastBatch(b []channel.Batch) error
- func (s *Server) Close()
- func (s *Server) GetUsers(ch string) []channel.User
- func (s *Server) Init() error
- func (s *Server) MustAddChannel(name string, c channel.Channel)
- func (s *Server) MustSetUserUpdateHandler(h channel.UserUpdateHandler)
- func (s *Server) Run() error
- func (s *Server) Save() error
- func (s *Server) SetUserUpdateHandler(h channel.UserUpdateHandler) error
- func (s *Server) Upload(filename string, r io.Reader) (*url.URL, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Arbitrary string clients will need to be able to connect ProtocolVersion string Key *crypto.Key Log *log.Logger // HTTP/WS listen address HTTPAddress string // TCP listen address TCPAddress string // Path to store databases StorePath string // Path to store uploads and from which the http server can serve files UploadsPath string MaxUploadSize int64 // HTTPS certs, leave empty to disable TLS Cert []byte CertKey []byte Router simplehttp.Router RWFactory channel.RWFactory // Interval to log bandwidth, 0 = no logging LogBandwidth time.Duration }
type NoopBandwidth ¶
type NoopBandwidth struct{}
func (*NoopBandwidth) Get ¶
func (n *NoopBandwidth) Get() (up, down float64, tup, tdown uint64)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) MustSetUserUpdateHandler ¶
func (s *Server) MustSetUserUpdateHandler(h channel.UserUpdateHandler)
func (*Server) SetUserUpdateHandler ¶
func (s *Server) SetUserUpdateHandler(h channel.UserUpdateHandler) error
Click to show internal directories.
Click to hide internal directories.