(ctx context.Context, parent dagql.ObjectResult[*core.EngineCache], args struct {
Key string `default:""`
})
| 93 | } |
| 94 | |
| 95 | func (s *engineSchema) cacheEntrySet(ctx context.Context, parent dagql.ObjectResult[*core.EngineCache], args struct { |
| 96 | Key string `default:""` |
| 97 | }) (inst dagql.Result[*core.EngineCacheEntrySet], _ error) { |
| 98 | query, err := core.CurrentQuery(ctx) |
| 99 | if err != nil { |
| 100 | return inst, err |
| 101 | } |
| 102 | if err := query.RequireMainClient(ctx); err != nil { |
| 103 | return inst, err |
| 104 | } |
| 105 | srv, err := query.Server.Server(ctx) |
| 106 | if err != nil { |
| 107 | return inst, fmt.Errorf("failed to get server: %w", err) |
| 108 | } |
| 109 | |
| 110 | if args.Key == "" { |
| 111 | err := srv.Select(ctx, parent, &inst, |
| 112 | dagql.Selector{ |
| 113 | Field: "entrySet", |
| 114 | Args: []dagql.NamedInput{ |
| 115 | { |
| 116 | Name: "key", |
| 117 | Value: dagql.NewString(identity.NewID()), |
| 118 | }, |
| 119 | }, |
| 120 | }, |
| 121 | ) |
| 122 | return inst, err |
| 123 | } |
| 124 | |
| 125 | entrySet, err := query.EngineLocalCacheEntries(ctx) |
| 126 | if err != nil { |
| 127 | return inst, fmt.Errorf("failed to load cache entries: %w", err) |
| 128 | } |
| 129 | |
| 130 | return dagql.NewResultForCurrentCall(ctx, entrySet) |
| 131 | } |
| 132 | |
| 133 | func (s *engineSchema) cachePrune(ctx context.Context, parent *core.EngineCache, args struct { |
| 134 | UseDefaultPolicy bool `default:"false"` |
nothing calls this directly
no test coverage detected