mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: align struct field comments (#7632)
This commit is contained in:
@ -2,33 +2,33 @@ module websocket
|
||||
|
||||
// MessageEventHandler represents a callback on a new message
|
||||
struct MessageEventHandler {
|
||||
handler SocketMessageFn // callback function
|
||||
handler SocketMessageFn // callback function
|
||||
handler2 SocketMessageFn2 // callback function with reference
|
||||
is_ref bool // true if has a reference object
|
||||
is_ref bool // true if has a reference object
|
||||
ref voidptr // referenced object
|
||||
}
|
||||
|
||||
// ErrorEventHandler represents a callback on error
|
||||
struct ErrorEventHandler {
|
||||
handler SocketErrorFn // callback function
|
||||
handler SocketErrorFn // callback function
|
||||
handler2 SocketErrorFn2 // callback function with reference
|
||||
is_ref bool // true if has a reference object
|
||||
is_ref bool // true if has a reference object
|
||||
ref voidptr // referenced object
|
||||
}
|
||||
|
||||
// OpenEventHandler represents a callback when connection is opened
|
||||
struct OpenEventHandler {
|
||||
handler SocketOpenFn // callback function
|
||||
handler SocketOpenFn // callback function
|
||||
handler2 SocketOpenFn2 // callback function with reference
|
||||
is_ref bool // true if has a reference object
|
||||
is_ref bool // true if has a reference object
|
||||
ref voidptr // referenced object
|
||||
}
|
||||
|
||||
// CloseEventHandler represents a callback on a closing event
|
||||
struct CloseEventHandler {
|
||||
handler SocketCloseFn // callback function
|
||||
handler SocketCloseFn // callback function
|
||||
handler2 SocketCloseFn2 // callback function with reference
|
||||
is_ref bool // true if has a reference object
|
||||
is_ref bool // true if has a reference object
|
||||
ref voidptr // referenced object
|
||||
}
|
||||
|
||||
|
@ -22,13 +22,13 @@ mut:
|
||||
header_len int = 2
|
||||
// size of total frame
|
||||
frame_size int = 2
|
||||
fin bool // true if final fragment of message
|
||||
rsv1 bool // reserved for future use in websocket RFC
|
||||
rsv2 bool // reserved for future use in websocket RFC
|
||||
rsv3 bool // reserved for future use in websocket RFC
|
||||
opcode OPCode // interpretation of the payload data
|
||||
has_mask bool // true if the payload data is masked
|
||||
payload_len int // payload length
|
||||
fin bool // true if final fragment of message
|
||||
rsv1 bool // reserved for future use in websocket RFC
|
||||
rsv2 bool // reserved for future use in websocket RFC
|
||||
rsv3 bool // reserved for future use in websocket RFC
|
||||
opcode OPCode // interpretation of the payload data
|
||||
has_mask bool // true if the payload data is masked
|
||||
payload_len int // payload length
|
||||
masking_key [4]byte // all frames from client to server is masked with this key
|
||||
}
|
||||
|
||||
|
@ -19,24 +19,24 @@ pub struct Client {
|
||||
is_server bool
|
||||
mut:
|
||||
ssl_conn &openssl.SSLConn // secure connection used when wss is used
|
||||
flags []Flag // flags used in handshake
|
||||
flags []Flag // flags used in handshake
|
||||
fragments []Fragment // current fragments
|
||||
message_callbacks []MessageEventHandler // all callbacks on_message
|
||||
error_callbacks []ErrorEventHandler // all callbacks on_error
|
||||
open_callbacks []OpenEventHandler // all callbacks on_open
|
||||
close_callbacks []CloseEventHandler // all callbacks on_close
|
||||
error_callbacks []ErrorEventHandler // all callbacks on_error
|
||||
open_callbacks []OpenEventHandler // all callbacks on_open
|
||||
close_callbacks []CloseEventHandler // all callbacks on_close
|
||||
pub:
|
||||
is_ssl bool // true if secure socket is used
|
||||
uri Uri // uri of current connection
|
||||
is_ssl bool // true if secure socket is used
|
||||
uri Uri // uri of current connection
|
||||
id string // unique id of client
|
||||
pub mut:
|
||||
conn net.TcpConn // underlying TCP socket connection
|
||||
nonce_size int = 16 // size of nounce used for masking
|
||||
panic_on_callback bool // set to true of callbacks can panic
|
||||
state State // current state of connection
|
||||
panic_on_callback bool // set to true of callbacks can panic
|
||||
state State // current state of connection
|
||||
logger &log.Log // logger used to log messages
|
||||
resource_name string // name of current resource
|
||||
last_pong_ut u64 // last time in unix time we got a pong message
|
||||
resource_name string // name of current resource
|
||||
last_pong_ut u64 // last time in unix time we got a pong message
|
||||
}
|
||||
|
||||
// Flag represents different types of headers in websocket handshake
|
||||
|
@ -11,13 +11,13 @@ import rand
|
||||
pub struct Server {
|
||||
mut:
|
||||
clients map[string]&ServerClient // clients connected to this server
|
||||
logger &log.Log // logger used to log
|
||||
ls net.TcpListener // listener used to get incoming connection to socket
|
||||
accept_client_callbacks []AcceptClientFn // accept client callback functions
|
||||
logger &log.Log // logger used to log
|
||||
ls net.TcpListener // listener used to get incoming connection to socket
|
||||
accept_client_callbacks []AcceptClientFn // accept client callback functions
|
||||
message_callbacks []MessageEventHandler // new message callback functions
|
||||
close_callbacks []CloseEventHandler // close message callback functions
|
||||
close_callbacks []CloseEventHandler // close message callback functions
|
||||
pub:
|
||||
port int // port used as listen to incoming connections
|
||||
port int // port used as listen to incoming connections
|
||||
is_ssl bool // true if secure connection (not supported yet on server)
|
||||
pub mut:
|
||||
ping_interval int = 30
|
||||
|
Reference in New Issue
Block a user