Initial commit
This commit is contained in:
27
payload/main.v
Normal file
27
payload/main.v
Normal file
@@ -0,0 +1,27 @@
|
||||
module main
|
||||
|
||||
import core
|
||||
import cryptography
|
||||
|
||||
fn main() {
|
||||
core.initialize()
|
||||
logs.info('main:main:main', 'Called initiliazer func!')
|
||||
|
||||
go fn(ch chan WsResult) {
|
||||
conn := core.establish_ws_conn() or {
|
||||
ch <- WsResult{err: 'Could not establish WS: $err'}
|
||||
return
|
||||
}
|
||||
ch <- WsResult{conn: conn}
|
||||
}(ch)
|
||||
|
||||
logs.info('main:main:main', 'Connecting to \'$configuration.websocket\'.')
|
||||
|
||||
res := <-ch
|
||||
|
||||
if res.err != none {
|
||||
logs.error('main:main:main', res.err or { 'Unknown error' })
|
||||
} else {
|
||||
logs.info('main:main:main', 'Successfully connected to WS on \'$configuration.websocket\'.')
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user