xcaddy
Build Caddy with plugins.
Installation
dagger install github.com/swanncroiset/daggerverse/xcaddy@v0.2.0
Entrypoint
Return Type
Xcaddy !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String | - | xcaddy version. |
container | Container | - | Custom container to use as an xcaddy (and Go) base container. |
goVersion | String | - | Version (image tag) to use from the official image repository as a Go base container. |
goContainer | Container | - | Custom container to use as a Go base container. |
Example
func (m *myModule) example() *Xcaddy {
return dag.
Xcaddy()
}
Types
Xcaddy 🔗
build() 🔗
Build Caddy with plugins.
Return Type
Build !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String | - | Caddy version. |
race | Boolean | - | Enables the Go race detector in the build. |
debug | Boolean | - | Enables the DWARF debug information in the build. |
Example
func (m *myModule) example() *XcaddyBuild {
return dag.
Xcaddy().
Build()
}
Build 🔗
Build Caddy with plugins.
version() 🔗
Caddy version.
Return Type
String !
Example
func (m *myModule) example(ctx context.Context) string {
return dag.
Xcaddy().
Build().
Version(ctx)
}
race() 🔗
Whether the Go race detector is enabled in the build.
Return Type
Boolean !
Example
func (m *myModule) example(ctx context.Context) bool {
return dag.
Xcaddy().
Build().
Race(ctx)
}
debug() 🔗
Whether the DWARF debug information is enabled in the build.
Return Type
Boolean !
Example
func (m *myModule) example(ctx context.Context) bool {
return dag.
Xcaddy().
Build().
Debug(ctx)
}
plugins() 🔗
List of plugins to include.
Return Type
[GoModule ! ] !
Example
func (m *myModule) example() []*XcaddyGoModule {
return dag.
Xcaddy().
Build().
Plugins()
}
replacements() 🔗
List of modules to replace.
Return Type
[GoModule ! ] !
Example
func (m *myModule) example() []*XcaddyGoModule {
return dag.
Xcaddy().
Build().
Replacements()
}
embeds() 🔗
List of embedded directories.
Return Type
[Embed ! ] !
Example
func (m *myModule) example() []*XcaddyEmbed {
return dag.
Xcaddy().
Build().
Embeds()
}
plugin() 🔗
Add plugins to the Caddy build.
Return Type
Build !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
module | String ! | - | Go module path. |
version | String | - | Go module version. |
replacement | Directory | - | Local replacement directory. |
Example
func (m *myModule) example(module string) *XcaddyBuild {
return dag.
Xcaddy().
Build().
Plugin(module)
}
replace() 🔗
Replace Caddy dependencies.
Return Type
Build !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
module | String ! | - | Go module path. |
version | String | - | Go module version. |
replacement | Directory | - | Local replacement directory. |
Example
func (m *myModule) example(module string) *XcaddyBuild {
return dag.
Xcaddy().
Build().
Replace(module)
}
embed() 🔗
Embed a directory in the Caddy binary.
Return Type
Build !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
alias | String ! | - | Name of the embedded directory. |
directory | Directory ! | - | Directory to embed in the binary. |
Example
func (m *myModule) example(alias string, directory *Directory) *XcaddyBuild {
return dag.
Xcaddy().
Build().
Embed(alias, directory)
}
binary() 🔗
Return a Caddy binary.
Return Type
File !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
platform | Scalar | - | Target platform in "[os]/[platform]/[version]" format (e.g., "darwin/arm64/v7", "windows/amd64", "linux/arm64"). |
Example
func (m *myModule) example() *File {
return dag.
Xcaddy().
Build().
Binary()
}
container() 🔗
Return a Caddy container.
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
base | String | "caddy" | Use the specified base image. |
platform | Scalar | - | Target platform in "[os]/[platform]/[version]" format (e.g., "darwin/arm64/v7", "windows/amd64", "linux/arm64"). |
Example
func (m *myModule) example() *Container {
return dag.
Xcaddy().
Build().
Container()
}
inspect() 🔗
Open a terminal to inspect the build files.
Return Type
Terminal !
Example
func (m *myModule) example() *Terminal {
return dag.
Xcaddy().
Build().
Inspect()
}
GoModule 🔗
path() 🔗
Go module path.
Return Type
String !
Example
Function XcaddyGoModule.path is not accessible from the xcaddy module
version() 🔗
Go module version (optional).
Return Type
String !
Example
Function XcaddyGoModule.version is not accessible from the xcaddy module
replacement() 🔗
Local replacement directory (optional).
Return Type
Directory !
Example
Function XcaddyGoModule.replacement is not accessible from the xcaddy module
Embed 🔗
alias() 🔗
Name of the embedded directory.
Return Type
String !
Example
Function XcaddyEmbed.alias is not accessible from the xcaddy module
directory() 🔗
Directory to embed in the binary.
Return Type
Directory !
Example
Function XcaddyEmbed.directory is not accessible from the xcaddy module