utils
A utility module for working with documentation site content
Installation
dagger install github.com/kpenfound/agents/docs/utils@56144b22672e3f8875eca4689202b5d39ae7c42c
Entrypoint
Return Type
Utils
Example
dagger -m github.com/kpenfound/agents/docs/utils@56144b22672e3f8875eca4689202b5d39ae7c42c call \
func (m *MyModule) Example() *dagger.Utils {
return dag.
Utils()
}
@function
def example() -> dagger.Utils:
return (
dag.utils()
)
@func()
example(): Utils {
return dag
.utils()
}
Types
Utils 🔗
grep() 🔗
Returns surrounding lines of the file that match a pattern using grep. If a match is not found, returns an error
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
file | File ! | - | Dagger file to search in |
pattern | String ! | - | Grep pattern to search in the file |
Example
dagger -m github.com/kpenfound/agents/docs/utils@56144b22672e3f8875eca4689202b5d39ae7c42c call \
grep --file file:path --pattern string
func (m *MyModule) Example(ctx context.Context, file *dagger.File, pattern string) string {
return dag.
Utils().
Grep(ctx, file, pattern)
}
@function
async def example(file: dagger.File, pattern: str) -> str:
return await (
dag.utils()
.grep(file, pattern)
)
@func()
async example(file: File, pattern: string): Promise<string> {
return dag
.utils()
.grep(file, pattern)
}