Documentation ¶
Index ¶
- Constants
- type AuthHeader
- type Client
- func (c *Client) AddRootCa(rootCA []byte)
- func (c *Client) ConnectAndServe(url string, header map[string]string) (err error)
- func (c *Client) DisableCommonNameCheck()
- func (c *Client) Disconnect() (err error)
- func (c *Client) Send(message Message) (err error)
- func (c *Client) SendTxt(message []byte) (err error)
- type Event
- type EventType
- type Events
- type EventsToChannel
- type HashAlgo
- type Message
- type Server
- func (s *Server) Broadcast(message *Message)
- func (s *Server) Close() (err error)
- func (s *Server) ListenAndServe() (err error)
- func (s *Server) Send(clientId int, message *Message) error
- func (s *Server) SetAuthHeader(authHeader *AuthHeader)
- func (s *Server) SetupTls(certificate []byte, privateKey []byte)
Constants ¶
View Source
const ( HashAlgoNone = 0 HashAlgoMD5 = 1 HashAlgoSHA256 = 2 )
View Source
const LogRegioWsClient = "websocket client"
View Source
const LogRegioWsServer = "ws server"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthHeader ¶
func NewAuthHeader ¶
func NewAuthHeader(headerKey string, headerValue string, valueHashAlgo HashAlgo) *AuthHeader
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ConnectAndServe ¶
func (*Client) DisableCommonNameCheck ¶
func (c *Client) DisableCommonNameCheck()
func (*Client) Disconnect ¶
type EventsToChannel ¶
type EventsToChannel struct {
// contains filtered or unexported fields
}
func NewEventsToChannel ¶
func NewEventsToChannel(messageChannel chan<- Message, eventChannel chan<- Event) *EventsToChannel
func (*EventsToChannel) OnConnect ¶
func (t *EventsToChannel) OnConnect(id int)
func (*EventsToChannel) OnDisconnect ¶
func (t *EventsToChannel) OnDisconnect(id int)
func (*EventsToChannel) OnFailure ¶
func (t *EventsToChannel) OnFailure(exited bool, err error)
func (*EventsToChannel) OnReceive ¶
func (t *EventsToChannel) OnReceive(msg Message)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ListenAndServe ¶
func (*Server) SetAuthHeader ¶
func (s *Server) SetAuthHeader(authHeader *AuthHeader)
Click to show internal directories.
Click to hide internal directories.