9front - general discussion about 9front
 help / color / mirror / Atom feed
From: ori@eigenstate.org
To: 9front@9front.org
Subject: Re: [9front] ndb/registry
Date: Mon, 31 Aug 2020 21:57:22 -0700	[thread overview]
Message-ID: <6BA572726B74565AC9F09D780007F6E7@eigenstate.org> (raw)
In-Reply-To: <324735A7-38EE-4288-87B3-765667AEF962@gmail.com>

> Hey, I’ve been working this last week on bringing ndb/registry over from inferno, but in a way that matches well with the rest of our ndb. 
> I have two binaries, ndb/registry and ndb/regquery. ndb/registry reads from /lib/ndb/registry, which would contain a list of local services you want to register on start up. They’re in regular ndb format, and look like
> 
> service=tcp!myipaddr!1234
> 	auth=none label=myservice
> 	mtpt=/n/myservice
> 
> You can add a service by writing, `add tcp!myipaddr!1234 label myservice [mtpt mymtpt label mylabel]` to /net/registry, rm `rm tcp!myipaddr!1234`, edit, `update tcp!myipaddr!1234 label newlabel` or any other tuple. Dump will create a dump of the current registry to /lib/ndb/regdump, refresh will reload the services from the db - while keeping any that you’ve added after startup untouched. 
> 
> regquery opens and reads /net/registry, and outputs any matching service descriptions `ndb/regquery myservice`, in tuple format; or as a plumbable string (currently only srv and srvtls) with -s, and will list all services when passed `ndb/regquery all`.
> 
> eg:
> 
> ndb/regquery grid
> service=tcp!myservice!1234 label=gridchat auth=none mtpt=/n/chat
> [ … ] // any other matches
> 
> ndb/regquery -s grid 
> srv tcp!myservice!1234 gridchat /n/chat
> [ … ] // any other matches
> 
> I use this with a database containing, at the moment the 9grid list of services, but would be useful for a general index of what services exist on a given network outright, on a remote network for bookkeeping, etc.
> 
> The code is fresh, and may have bugs I haven’t caught! I’ll include the diff here, thanks!
> 
>  - halfwit 

(Mostly repeating what I said on grid)

I'll try to take a look at this soon, but I'd be against
merging it until this gets used in anger. Usually it's
when an API actually gets used that improvements come
out. If you have code that uses this, I'd like to see it.



      reply	other threads:[~2020-09-01  4:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-29  4:17 ndb/registry Michael Misch
2020-09-01  4:57 ` ori [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6BA572726B74565AC9F09D780007F6E7@eigenstate.org \
    --to=ori@eigenstate.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).