MCPcopy Create free account
hub / github.com/elimity-com/scim / GetAll

Method GetAll

resource_handler_test.go:92–121  ·  view source on GitHub ↗
(r *http.Request, params ListRequestParams)

Source from the content-addressed store, hash-verified

90}
91
92func (h testResourceHandler) GetAll(r *http.Request, params ListRequestParams) (Page, error) {
93 if params.Count == 0 {
94 return Page{
95 TotalResults: len(h.data),
96 }, nil
97 }
98
99 resources := make([]Resource, 0)
100 i := 1
101
102 for k, v := range h.data {
103 if i > (params.StartIndex + params.Count - 1) {
104 break
105 }
106
107 if i >= params.StartIndex {
108 resources = append(resources, Resource{
109 ID: k,
110 ExternalID: h.externalID(v.resourceAttributes),
111 Attributes: v.resourceAttributes,
112 })
113 }
114 i++
115 }
116
117 return Page{
118 TotalResults: len(h.data),
119 Resources: resources,
120 }, nil
121}
122
123func (h testResourceHandler) Patch(r *http.Request, id string, operations []PatchOperation) (Resource, error) {
124 if h.shouldReturnNoContent(id, operations) {

Callers

nothing calls this directly

Calls 1

externalIDMethod · 0.95

Tested by

no test coverage detected