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

Method WithFile

sdk/python/runtime/internal/dagger/dagger.gen.go:3135–3158  ·  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

3133
3134// Return a container snapshot with a file added
3135func (r *Container) WithFile(path string, source *File, opts ...ContainerWithFileOpts) *Container {
3136 assertNotNil("source", source)
3137 q := r.query.Select("withFile")
3138 for i := len(opts) - 1; i >= 0; i-- {
3139 // `permissions` optional argument
3140 if !querybuilder.IsZeroValue(opts[i].Permissions) {
3141 q = q.Arg("permissions", opts[i].Permissions)
3142 }
3143 // `owner` optional argument
3144 if !querybuilder.IsZeroValue(opts[i].Owner) {
3145 q = q.Arg("owner", opts[i].Owner)
3146 }
3147 // `expand` optional argument
3148 if !querybuilder.IsZeroValue(opts[i].Expand) {
3149 q = q.Arg("expand", opts[i].Expand)
3150 }
3151 }
3152 q = q.Arg("path", path)
3153 q = q.Arg("source", source)
3154
3155 return &Container{
3156 query: q,
3157 }
3158}
3159
3160// ContainerWithFilesOpts contains options for Container.WithFiles
3161type ContainerWithFilesOpts struct {

Callers 2

AddFileMethod · 0.45
WithTemplateMethod · 0.45

Calls 3

assertNotNilFunction · 0.70
SelectMethod · 0.65
ArgMethod · 0.45

Tested by

no test coverage detected