MCPcopy Index your code
hub / github.com/dagger/dagger / WithFile

Method WithFile

toolchains/engine-dev/internal/dagger/dagger.gen.go:3156–3179  ·  view source on GitHub ↗

Return a container snapshot with a file added

(path string, source *File, opts ...ContainerWithFileOpts)

Source from the content-addressed store, hash-verified

3154
3155// Return a container snapshot with a file added
3156func (r *Container) WithFile(path string, source *File, opts ...ContainerWithFileOpts) *Container {
3157 assertNotNil("source", source)
3158 q := r.query.Select("withFile")
3159 for i := len(opts) - 1; i >= 0; i-- {
3160 // `permissions` optional argument
3161 if !querybuilder.IsZeroValue(opts[i].Permissions) {
3162 q = q.Arg("permissions", opts[i].Permissions)
3163 }
3164 // `owner` optional argument
3165 if !querybuilder.IsZeroValue(opts[i].Owner) {
3166 q = q.Arg("owner", opts[i].Owner)
3167 }
3168 // `expand` optional argument
3169 if !querybuilder.IsZeroValue(opts[i].Expand) {
3170 q = q.Arg("expand", opts[i].Expand)
3171 }
3172 }
3173 q = q.Arg("path", path)
3174 q = q.Arg("source", source)
3175
3176 return &Container{
3177 query: q,
3178 }
3179}
3180
3181// ContainerWithFilesOpts contains options for Container.WithFiles
3182type ContainerWithFilesOpts struct {

Callers 5

testContainerMethod · 0.45
pprofDumpMethod · 0.45
ContainerMethod · 0.45
IntrospectionJSONMethod · 0.45
GraphqlSchemaMethod · 0.45

Calls 3

assertNotNilFunction · 0.70
SelectMethod · 0.65
ArgMethod · 0.45

Tested by

no test coverage detected