dagger/dsl/file
Types
pub type Opts {
Opts(
permissions: option.Option(Int),
offset_lines: option.Option(Int),
limit_lines: option.Option(Int),
exclude_metadata: option.Option(Bool),
allow_parent_dir_path: option.Option(Bool),
literal: option.Option(Bool),
multiline: option.Option(Bool),
dotall: option.Option(Bool),
insensitive: option.Option(Bool),
skip_ignored: option.Option(Bool),
skip_hidden: option.Option(Bool),
files_only: option.Option(Bool),
limit: option.Option(Int),
paths: option.Option(List(String)),
globs: option.Option(List(String)),
all: option.Option(Bool),
first_from: option.Option(Int),
)
}
Constructors
-
Opts( permissions: option.Option(Int), offset_lines: option.Option(Int), limit_lines: option.Option(Int), exclude_metadata: option.Option(Bool), allow_parent_dir_path: option.Option(Bool), literal: option.Option(Bool), multiline: option.Option(Bool), dotall: option.Option(Bool), insensitive: option.Option(Bool), skip_ignored: option.Option(Bool), skip_hidden: option.Option(Bool), files_only: option.Option(Bool), limit: option.Option(Int), paths: option.Option(List(String)), globs: option.Option(List(String)), all: option.Option(Bool), first_from: option.Option(Int), )
Values
pub fn as_j_s_o_n(parent: types.File) -> types.JSONValue
Parse the file contents as JSON.
pub fn chown(
parent: types.File,
owner owner: String,
) -> types.File
Change the owner of the file recursively.
pub fn contents(
parent: types.File,
with with_fn: fn(Opts) -> Opts,
client client: types.Client,
then handler: fn(Result(String, types.QueryError)) -> a,
) -> a
Retrieves the contents of the file.
pub fn digest(
parent: types.File,
with with_fn: fn(Opts) -> Opts,
client client: types.Client,
then handler: fn(Result(String, types.QueryError)) -> a,
) -> a
Return the file’s digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.
pub fn export(
parent: types.File,
path path: String,
with with_fn: fn(Opts) -> Opts,
client client: types.Client,
then handler: fn(Result(String, types.QueryError)) -> a,
) -> a
Writes the file to a file path on the host.
pub fn file(
name name: String,
contents contents: String,
with with_fn: fn(Opts) -> Opts,
) -> types.File
pub fn name(
parent: types.File,
client client: types.Client,
then handler: fn(Result(String, types.QueryError)) -> a,
) -> a
Retrieves the name of the file.
pub fn search(
parent: types.File,
pattern pattern: String,
with with_fn: fn(Opts) -> Opts,
select select: fn(types.SearchResult) -> List(types.Field),
client client: types.Client,
then handler: fn(
Result(List(types.SearchResult), types.QueryError),
) -> a,
) -> a
Searches for content matching the given regular expression or literal string. Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
pub fn size(
parent: types.File,
client client: types.Client,
then handler: fn(Result(Int, types.QueryError)) -> a,
) -> a
Retrieves the size of the file, in bytes.
pub fn with_name(
parent: types.File,
name name: String,
) -> types.File
Retrieves this file with its name set to the given name.
pub fn with_replaced(
parent: types.File,
search search: String,
replacement replacement: String,
with with_fn: fn(Opts) -> Opts,
) -> types.File
Retrieves the file with content replaced with the given text. If ‘all’ is true, all occurrences of the pattern will be replaced. If ‘firstAfter’ is specified, only the first match starting at the specified line will be replaced. If neither are specified, and there are multiple matches for the pattern, this will error. If there are no matches for the pattern, this will error.
pub fn with_timestamps(
parent: types.File,
timestamp timestamp: Int,
) -> types.File
Retrieves this file with its created/modified timestamps set to the given time.