Created
July 22, 2020 04:26
-
-
Save domino14/7049bdf12b1b86aaa149a49a6947ed5b to your computer and use it in GitHub Desktop.
Register a realm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resp, err := h.pubsub.natsconn.Request("ipc.request.registerRealm", data, ipcTimeout) | |
if err != nil { | |
log.Err(err).Msg("timeout registering realm") | |
return err | |
} | |
// The response contains the correct realm for the user. | |
rrResp := &pb.RegisterRealmResponse{} | |
err = proto.Unmarshal(resp.Data, rrResp) | |
if err != nil { | |
return err | |
} | |
realm = rrResp.Realm | |
if Realm(realm) != NullRealm { | |
// Only add to the realm that the API says to add to. | |
h.addToRealm(Realm(realm), c) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment