dnsmanager/src/network.cr

36 lines
626 B
Crystal
Raw Normal View History

2020-12-03 17:13:40 +01:00
require "ipc"
require "json"
class IPC::JSON
def handle(service : IPC::Server, event : IPC::Event::Events)
raise "unimplemented"
end
end
module DNSManager
class_getter requests = [] of IPC::JSON.class
class_getter responses = [] of IPC::JSON.class
end
class DNSManager::Response
IPC::JSON.message Error, 0 do
property reason : String | Array(String)
def initialize(@reason)
end
end
IPC::JSON.message Success, 1 do
def initialize
end
end
end
class DNSManager::Request
IPC::JSON.message Login, 0 do
end
IPC::JSON.message Logout, 1 do
end
DNSManager.requests << Logout
end
# require "./requests/*"