(ctx context.Context, appID *ttnpb.ApplicationIdentifiers)
| 196 | } |
| 197 | |
| 198 | func (f *inMemoryCache) ApplicationRights(ctx context.Context, appID *ttnpb.ApplicationIdentifiers) (rights *ttnpb.Rights, err error) { |
| 199 | defer func() { registerRightsRequest(ctx, "application", rights, err) }() |
| 200 | req := newEntityReq(ctx, appID.GetEntityIdentifiers()) |
| 201 | f.mu.Lock() |
| 202 | res := f.applicationRights[req] |
| 203 | if !res.valid(f.successTTL, f.errorTTL) { |
| 204 | res = newRes() |
| 205 | f.applicationRights[req] = res |
| 206 | go func() { |
| 207 | res.set(f.Fetcher.ApplicationRights(ctx, appID)) |
| 208 | }() |
| 209 | } |
| 210 | f.maybeCleanup() |
| 211 | f.mu.Unlock() |
| 212 | if err := res.wait(ctx); err != nil { |
| 213 | return nil, err |
| 214 | } |
| 215 | return res.rights, res.err |
| 216 | } |
| 217 | |
| 218 | func (f *inMemoryCache) ClientRights(ctx context.Context, clientID *ttnpb.ClientIdentifiers) (rights *ttnpb.Rights, err error) { |
| 219 | defer func() { registerRightsRequest(ctx, "client", rights, err) }() |
nothing calls this directly
no test coverage detected