any chance I could hit you up to write me a little gist of how to write an auth interceptor? Im struggling with the context / executor / attach / detatch abstractions
ejona
Oh, cagedwisdom you're back.
I can tell you how to use Context, too.
cagedwisdom
that would be great
pixelate
yeah ... it's funny -- you just get into "flow" of doing something -- at any given time our system is probably interacting with 15+ external APIs -- all of which I'd categorize as some kind of REST version... not all of them have proper clients, so for one-offs I usually just do the req, err := http.NewRequest(); cl := &http.Client{}; cl.Do(req) or whatever
ejona
So Context is (most) immutable. So withValue returns a new instance.
cagedwisdom: Have you tried to use Contexts.interceptCall?
cagedwisdom
yes, I know that part of my code is right, but not sure about the other parts.
ejona
So Contexts.interceptCall should remove most dealing with attach/detach.
You're having trouble with passing work onto another executor and having Context follow?