MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / collectNodeUserIDs

Function collectNodeUserIDs

internal/serverapi/api.go:782–792  ·  view source on GitHub ↗

collectNodeUserIDs 提取用户凭据列表中去重后的 UserID(api.go 内部使用)。

(accesses []users.UserInbound)

Source from the content-addressed store, hash-verified

780
781// collectNodeUserIDs 提取用户凭据列表中去重后的 UserID(api.go 内部使用)。
782func collectNodeUserIDs(accesses []users.UserInbound) []string {
783 seen := make(map[string]struct{})
784 out := make([]string, 0)
785 for _, acc := range accesses {
786 if _, ok := seen[acc.UserID]; !ok {
787 seen[acc.UserID] = struct{}{}
788 out = append(out, acc.UserID)
789 }
790 }
791 return out
792}
793
794func (a *API) clientFor(nodeID string) (*nodes.Client, error) {
795 // 命中缓存直接返回(避免重复构造)

Callers 2

handleNodeRestartMethod · 0.85
handleNodeApplyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected