MCPcopy Create free account
hub / github.com/dagger/dagger / RequestedCacheInput

Function RequestedCacheInput

dagql/cache_inputs.go:78–92  ·  view source on GitHub ↗

RequestedCacheInput scopes a call ID according to a boolean argument: false => PerClientInput, true => PerCallInput.

(argName string)

Source from the content-addressed store, hash-verified

76// RequestedCacheInput scopes a call ID according to a boolean argument:
77// false => PerClientInput, true => PerCallInput.
78func RequestedCacheInput(argName string) ImplicitInput {
79 return ImplicitInput{
80 Name: "cacheAsRequested:" + argName,
81 Resolver: func(ctx context.Context, args map[string]Input) (Input, error) {
82 noCache, err := inputBoolArg(args, argName)
83 if err != nil {
84 return nil, err
85 }
86 if noCache {
87 return PerCallInput.Resolver(ctx, args)
88 }
89 return PerClientInput.Resolver(ctx, args)
90 },
91 }
92}
93
94func inputBoolArg(args map[string]Input, argName string) (bool, error) {
95 raw, ok := args[argName]

Callers 3

InstallMethod · 0.92
InstallMethod · 0.92

Calls 1

inputBoolArgFunction · 0.85

Tested by 1