Implement indexing into Apache Druid #1

Closed
m wants to merge 263 commits from druid into master
1 changed files with 15 additions and 0 deletions
Showing only changes of commit b871fea039 - Show all commits

View File

@ -508,3 +508,18 @@ class API(object):
else: else:
main.IRCPool[name].sendmsg(channel, msg) main.IRCPool[name].sendmsg(channel, msg)
return dumps({"success": True, "message": f"sent message to {channel} on {name}"}) return dumps({"success": True, "message": f"sent message to {channel} on {name}"})
@app.route("/irc/nick/<net>/<num>/", methods=["GET"])
@login_required
def irc_get_nick(self, request, net, num):
if net not in main.network.keys():
return dumps({"success": False, "reason": "no such net."})
if not num.isdigit():
return dumps({"success": False, "reason": "invalid num: not a number."})
num = int(num)
if num not in main.network[net].relays.keys():
return dumps({"success": False, "reason": f"no relay {num} on {net}"})
name = f"{net}{num}"
if name not in main.IRCPool.keys():
return dumps({"success": False, "reason": f"relay {num} not on {net}"})
return dumps({"nickname": main.IRCPool[name].nickname})