Documentation ¶
Index ¶
- type ClientPolicy
- type Config
- type PolicyLoader
- 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() error
- 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) RunChannels() error
- func (s *Server) RunHTTP() error
- func (s *Server) RunTCP() 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 ClientPolicy ¶ added in v0.3.8
type ClientPolicy string
const ( PolicyWorld ClientPolicy = "world" PolicyAllow ClientPolicy = "allow" PolicyFixed ClientPolicy = "fixed" )
type Config ¶
type Config struct { // Arbitrary string clients will need to be able to connect ProtocolVersion string // PolicyLoader should return all allowed users and their names PolicyLoader PolicyLoader Key *crypto.Key Log *log.Logger // HTTP link address HTTPPublicAddress string // 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 PolicyLoader ¶ added in v0.3.8
type PolicyLoader interface { Policy() ClientPolicy Exists(fingerprint string) (name string, err error) }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) MustSetUserUpdateHandler ¶
func (s *Server) MustSetUserUpdateHandler(h channel.UserUpdateHandler)
func (*Server) RunChannels ¶ added in v0.3.6
func (*Server) SetUserUpdateHandler ¶
func (s *Server) SetUserUpdateHandler(h channel.UserUpdateHandler) error
Click to show internal directories.
Click to hide internal directories.