go
No long description provided.
Installation
dagger install gitlab.com/build-core/daggerverse/go@v0.9.0Entrypoint
Return Type
Go !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| goVersion | String ! | "1.24" | Version de Go à utiliser. Défaut : 1.24 |
Example
dagger -m gitlab.com/build-core/daggerverse/go@d807674c2fe27434092957b68f52e7fed015471c call \
--go-version stringfunc (m *MyModule) Example(goVersion string) *dagger.Go {
return dag.
Go(goVersion)
}@function
def example(go_version: str) -> dagger.Go:
return (
dag.go(go_version)
)@func()
example(goVersion: string): Go {
return dag
.go(goVersion)
}Types
Go 🔗
goVersion() 🔗
Version de Go à utiliser. Défaut : 1.24
Return Type
String ! Example
dagger -m gitlab.com/build-core/daggerverse/go@d807674c2fe27434092957b68f52e7fed015471c call \
--go-version string go-versionfunc (m *MyModule) Example(ctx context.Context, goVersion string) string {
return dag.
Go(goVersion).
GoVersion(ctx)
}@function
async def example(go_version: str) -> str:
return await (
dag.go(go_version)
.go_version()
)@func()
async example(goVersion: string): Promise<string> {
return dag
.go(goVersion)
.goVersion()
}build() 🔗
Build compile le projet Go et retourne le binaire
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | Le répertoire source du projet Go |
| mainPath | String ! | "./cmd/api" | Chemin vers le package main à compiler |
| migrationsPathSrc | String ! | "" | Chemin vers le répertoire des migrations |
| migrationsPathDst | String ! | "/migrations" | Chemin de destination des migrations dans le conteneur |
| modeDev | Boolean ! | false | Mode dev : Si activé, le binaire est copié dans une image alpine pour faciliter le debug. Sinon, le binaire est copie dans une image scratch. |
Example
dagger -m gitlab.com/build-core/daggerverse/go@d807674c2fe27434092957b68f52e7fed015471c call \
--go-version string build --src DIR_PATH --main-path string --migrations-path-src string --migrations-path-dst string --mode-dev booleanfunc (m *MyModule) Example(goVersion string, src *dagger.Directory, mainPath string, migrationsPathSrc string, migrationsPathDst string, modeDev bool) *dagger.Container {
return dag.
Go(goVersion).
Build(src, mainPath, migrationsPathSrc, migrationsPathDst, modeDev)
}@function
def example(go_version: str, src: dagger.Directory, main_path: str, migrations_path_src: str, migrations_path_dst: str, mode_dev: bool) -> dagger.Container:
return (
dag.go(go_version)
.build(src, main_path, migrations_path_src, migrations_path_dst, mode_dev)
)@func()
example(goVersion: string, src: Directory, mainPath: string, migrationsPathSrc: string, migrationsPathDst: string, modeDev: boolean): Container {
return dag
.go(goVersion)
.build(src, mainPath, migrationsPathSrc, migrationsPathDst, modeDev)
}