-
Notifications
You must be signed in to change notification settings - Fork 827
Agent alias #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Agent alias #16
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this feature request. I think that some of the code might be over complicated. I don't think there needs to be a global variables in the agents
package. The zero value for Agent.Alias
is the same as AliasNotSet
, making it redundant. The SetAlias
function takes in a slice, but I'm not sure why. I'm thinking there is no need for the SetAlias
function? Could you elaborate on the intentions of the function?
Would the following sudo code work?
set alias
for every agent, check to see if is already in use
if not Agent.Alias =
I think all of this can take place in the cli
package.
Would it be valuable to just set Agent.Alias
to the string representation of its ID when it is instantiated and then update CLI to just use the alias instead of figuring out if it has an alias or not?
pkg/agents/agents.go
Outdated
var paddingMax = 4096 | ||
|
||
type agent struct { | ||
ID uuid.UUID | ||
Alias string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix spacing
Would it make sense to make it a Agent.Name instead of Agent.Alias? |
@@ -48,10 +48,15 @@ import ( | |||
|
|||
// Agents contains all of the instantiated agent object that are accessed by other modules | |||
var Agents = make(map[uuid.UUID]*agent) | |||
// AgentAliasToID contains a mapping of each agent alias to its corresponding UUID | |||
var AgentAliasToID = make(map[string] uuid.UUID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be exported?
Let's create an Agent log entry to record what the agent's alias was changed to. |
I've let this PR from 2018 go stale by not implementing it. The code has significantly changed. Going to close this. |
Pull Request (PR) Checklist
Change Type
Description
added support for agent alias - fixed #5