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

Function collectUserIDs

internal/serverapi/users.go:733–743  ·  view source on GitHub ↗

collectUserIDs 从 accesses 中提取去重后的 UserID(serverapi 内部使用)。

(accesses []users.UserInbound)

Source from the content-addressed store, hash-verified

731
732// collectUserIDs 从 accesses 中提取去重后的 UserID(serverapi 内部使用)。
733func collectUserIDs(accesses []users.UserInbound) []string {
734 seen := make(map[string]struct{})
735 out := make([]string, 0)
736 for _, acc := range accesses {
737 if _, ok := seen[acc.UserID]; !ok {
738 seen[acc.UserID] = struct{}{}
739 out = append(out, acc.UserID)
740 }
741 }
742 return out
743}
744
745// syncUserInbounds reconciles a user's inbound assignments. Returns affected node IDs.
746func (a *userAPI) syncUserInbounds(userID string, selectedIDs []string) ([]string, error) {

Callers 1

handleAccessApplyMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected