(ctx context.Context)
| 174 | } |
| 175 | |
| 176 | func (f *inMemoryCache) AuthInfo(ctx context.Context) (authInfo *ttnpb.AuthInfoResponse, err error) { |
| 177 | defer func() { registerAuthInfoRequest(ctx, authInfo, err) }() |
| 178 | req := newReq(ctx) |
| 179 | f.mu.Lock() |
| 180 | res := f.authInfo[req] |
| 181 | if !res.valid(f.successTTL, f.errorTTL) { |
| 182 | res = &cachedAuthInfoRes{ |
| 183 | cachedRes: newRes(), |
| 184 | } |
| 185 | f.authInfo[req] = res |
| 186 | go func() { |
| 187 | res.set(f.Fetcher.AuthInfo(ctx)) |
| 188 | }() |
| 189 | } |
| 190 | f.maybeCleanup() |
| 191 | f.mu.Unlock() |
| 192 | if err := res.wait(ctx); err != nil { |
| 193 | return nil, err |
| 194 | } |
| 195 | return res.authInfo, res.err |
| 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) }() |
nothing calls this directly
no test coverage detected