Return a new container snapshot, with a file added to its filesystem with text content
(path string, contents string, opts ...ContainerWithNewFileOpts)
| 3421 | |
| 3422 | // Return a new container snapshot, with a file added to its filesystem with text content |
| 3423 | func (r *Container) WithNewFile(path string, contents string, opts ...ContainerWithNewFileOpts) *Container { |
| 3424 | q := r.query.Select("withNewFile") |
| 3425 | for i := len(opts) - 1; i >= 0; i-- { |
| 3426 | // `permissions` optional argument |
| 3427 | if !querybuilder.IsZeroValue(opts[i].Permissions) { |
| 3428 | q = q.Arg("permissions", opts[i].Permissions) |
| 3429 | } |
| 3430 | // `owner` optional argument |
| 3431 | if !querybuilder.IsZeroValue(opts[i].Owner) { |
| 3432 | q = q.Arg("owner", opts[i].Owner) |
| 3433 | } |
| 3434 | // `expand` optional argument |
| 3435 | if !querybuilder.IsZeroValue(opts[i].Expand) { |
| 3436 | q = q.Arg("expand", opts[i].Expand) |
| 3437 | } |
| 3438 | } |
| 3439 | q = q.Arg("path", path) |
| 3440 | q = q.Arg("contents", contents) |
| 3441 | |
| 3442 | return &Container{ |
| 3443 | query: q, |
| 3444 | } |
| 3445 | } |
| 3446 | |
| 3447 | // Attach credentials for future publishing to a registry. Use in combination with publish |
| 3448 | func (r *Container) WithRegistryAuth(address string, username string, secret *Secret) *Container { |
no test coverage detected