Documentation ¶
Index ¶
- func ServeCommands(entrypoints ...any)
- type BuildArg
- type CacheID
- type CacheSharingMode
- type CacheVolume
- type Client
- func (r *Client) CacheVolume(key string) *CacheVolume
- func (r *Client) CheckVersionCompatibility(ctx context.Context, version string) (bool, error)
- func (c *Client) Close() error
- func (r *Client) Container(opts ...ContainerOpts) *Container
- func (r *Client) DefaultPlatform(ctx context.Context) (Platform, error)
- func (r *Client) Directory(opts ...DirectoryOpts) *Directory
- func (c *Client) Do(ctx context.Context, req *Request, resp *Response) error
- func (r *Client) File(id FileID) *File
- func (r *Client) Git(url string, opts ...GitOpts) *GitRepository
- func (r *Client) HTTP(url string, opts ...HTTPOpts) *File
- func (r *Client) Host() *Host
- func (r *Client) Pipeline(name string, opts ...PipelineOpts) *Client
- func (r *Client) Project(opts ...ProjectOpts) *Project
- func (r *Client) ProjectCommand(opts ...ProjectCommandOpts) *ProjectCommand
- func (r *Client) Secret(id SecretID) *Secret
- func (r *Client) SetSecret(name string, plaintext string) *Secret
- func (r *Client) Socket(opts ...SocketOpts) *Socket
- func (r *Client) With(f WithClientFunc) *Client
- type ClientOpt
- type Container
- func (r *Container) Build(context *Directory, opts ...ContainerBuildOpts) *Container
- func (r *Container) DefaultArgs(ctx context.Context) ([]string, error)
- func (r *Container) Directory(path string) *Directory
- func (r *Container) Endpoint(ctx context.Context, opts ...ContainerEndpointOpts) (string, error)
- func (r *Container) Entrypoint(ctx context.Context) ([]string, error)
- func (r *Container) EnvVariable(ctx context.Context, name string) (string, error)
- func (r *Container) EnvVariables(ctx context.Context) ([]EnvVariable, error)
- func (r *Container) Export(ctx context.Context, path string, opts ...ContainerExportOpts) (bool, error)
- func (r *Container) ExposedPorts(ctx context.Context) ([]Port, error)
- func (r *Container) File(path string) *File
- func (r *Container) From(address string) *Container
- func (r *Container) Hostname(ctx context.Context) (string, error)
- func (r *Container) ID(ctx context.Context) (ContainerID, error)
- func (r *Container) ImageRef(ctx context.Context) (string, error)
- func (r *Container) Import(source *File, opts ...ContainerImportOpts) *Container
- func (r *Container) Label(ctx context.Context, name string) (string, error)
- func (r *Container) Labels(ctx context.Context) ([]Label, error)
- func (r *Container) Mounts(ctx context.Context) ([]string, error)
- func (r *Container) Pipeline(name string, opts ...ContainerPipelineOpts) *Container
- func (r *Container) Platform(ctx context.Context) (Platform, error)
- func (r *Container) Publish(ctx context.Context, address string, opts ...ContainerPublishOpts) (string, error)
- func (r *Container) Rootfs() *Directory
- func (r *Container) Stderr(ctx context.Context) (string, error)
- func (r *Container) Stdout(ctx context.Context) (string, error)
- func (r *Container) Sync(ctx context.Context) (*Container, error)
- func (r *Container) User(ctx context.Context) (string, error)
- func (r *Container) With(f WithContainerFunc) *Container
- func (r *Container) WithDefaultArgs(opts ...ContainerWithDefaultArgsOpts) *Container
- func (r *Container) WithDirectory(path string, directory *Directory, opts ...ContainerWithDirectoryOpts) *Container
- func (r *Container) WithEntrypoint(args []string) *Container
- func (r *Container) WithEnvVariable(name string, value string, opts ...ContainerWithEnvVariableOpts) *Container
- func (r *Container) WithExec(args []string, opts ...ContainerWithExecOpts) *Container
- func (r *Container) WithExposedPort(port int, opts ...ContainerWithExposedPortOpts) *Container
- func (r *Container) WithFile(path string, source *File, opts ...ContainerWithFileOpts) *Container
- func (r *Container) WithFocus() *Container
- func (r *Container) WithLabel(name string, value string) *Container
- func (r *Container) WithMountedCache(path string, cache *CacheVolume, opts ...ContainerWithMountedCacheOpts) *Container
- func (r *Container) WithMountedDirectory(path string, source *Directory, opts ...ContainerWithMountedDirectoryOpts) *Container
- func (r *Container) WithMountedFile(path string, source *File, opts ...ContainerWithMountedFileOpts) *Container
- func (r *Container) WithMountedSecret(path string, source *Secret, opts ...ContainerWithMountedSecretOpts) *Container
- func (r *Container) WithMountedTemp(path string) *Container
- func (r *Container) WithNewFile(path string, opts ...ContainerWithNewFileOpts) *Container
- func (r *Container) WithRegistryAuth(address string, username string, secret *Secret) *Container
- func (r *Container) WithRootfs(directory *Directory) *Container
- func (r *Container) WithSecretVariable(name string, secret *Secret) *Container
- func (r *Container) WithServiceBinding(alias string, service *Container) *Container
- func (r *Container) WithUnixSocket(path string, source *Socket, opts ...ContainerWithUnixSocketOpts) *Container
- func (r *Container) WithUser(name string) *Container
- func (r *Container) WithWorkdir(path string) *Container
- func (r *Container) WithoutEnvVariable(name string) *Container
- func (r *Container) WithoutExposedPort(port int, opts ...ContainerWithoutExposedPortOpts) *Container
- func (r *Container) WithoutFocus() *Container
- func (r *Container) WithoutLabel(name string) *Container
- func (r *Container) WithoutMount(path string) *Container
- func (r *Container) WithoutRegistryAuth(address string) *Container
- func (r *Container) WithoutUnixSocket(path string) *Container
- func (r *Container) Workdir(ctx context.Context) (string, error)
- func (r *Container) XXX_GraphQLID(ctx context.Context) (string, error)
- func (r *Container) XXX_GraphQLIDType() string
- func (r *Container) XXX_GraphQLType() string
- type ContainerBuildOpts
- type ContainerEndpointOpts
- type ContainerExportOpts
- type ContainerID
- type ContainerImportOpts
- type ContainerOpts
- type ContainerPipelineOpts
- type ContainerPublishOpts
- type ContainerWithDefaultArgsOpts
- type ContainerWithDirectoryOpts
- type ContainerWithEnvVariableOpts
- type ContainerWithExecOpts
- type ContainerWithExposedPortOpts
- type ContainerWithFileOpts
- type ContainerWithMountedCacheOpts
- type ContainerWithMountedDirectoryOpts
- type ContainerWithMountedFileOpts
- type ContainerWithMountedSecretOpts
- type ContainerWithNewFileOpts
- type ContainerWithUnixSocketOpts
- type ContainerWithoutExposedPortOpts
- type Context
- type Directory
- func (r *Directory) Diff(other *Directory) *Directory
- func (r *Directory) Directory(path string) *Directory
- func (r *Directory) DockerBuild(opts ...DirectoryDockerBuildOpts) *Container
- func (r *Directory) Entries(ctx context.Context, opts ...DirectoryEntriesOpts) ([]string, error)
- func (r *Directory) Export(ctx context.Context, path string) (bool, error)
- func (r *Directory) File(path string) *File
- func (r *Directory) ID(ctx context.Context) (DirectoryID, error)
- func (r *Directory) Pipeline(name string, opts ...DirectoryPipelineOpts) *Directory
- func (r *Directory) Sync(ctx context.Context) (*Directory, error)
- func (r *Directory) With(f WithDirectoryFunc) *Directory
- func (r *Directory) WithDirectory(path string, directory *Directory, opts ...DirectoryWithDirectoryOpts) *Directory
- func (r *Directory) WithFile(path string, source *File, opts ...DirectoryWithFileOpts) *Directory
- func (r *Directory) WithNewDirectory(path string, opts ...DirectoryWithNewDirectoryOpts) *Directory
- func (r *Directory) WithNewFile(path string, contents string, opts ...DirectoryWithNewFileOpts) *Directory
- func (r *Directory) WithTimestamps(timestamp int) *Directory
- func (r *Directory) WithoutDirectory(path string) *Directory
- func (r *Directory) WithoutFile(path string) *Directory
- func (r *Directory) XXX_GraphQLID(ctx context.Context) (string, error)
- func (r *Directory) XXX_GraphQLIDType() string
- func (r *Directory) XXX_GraphQLType() string
- type DirectoryDockerBuildOpts
- type DirectoryEntriesOpts
- type DirectoryID
- type DirectoryOpts
- type DirectoryPipelineOpts
- type DirectoryWithDirectoryOpts
- type DirectoryWithFileOpts
- type DirectoryWithNewDirectoryOpts
- type DirectoryWithNewFileOpts
- type EnvVariable
- type ExecError
- type File
- func (r *File) Contents(ctx context.Context) (string, error)
- func (r *File) Export(ctx context.Context, path string, opts ...FileExportOpts) (bool, error)
- func (r *File) ID(ctx context.Context) (FileID, error)
- func (r *File) Size(ctx context.Context) (int, error)
- func (r *File) Sync(ctx context.Context) (*File, error)
- func (r *File) With(f WithFileFunc) *File
- func (r *File) WithTimestamps(timestamp int) *File
- func (r *File) XXX_GraphQLID(ctx context.Context) (string, error)
- func (r *File) XXX_GraphQLIDType() string
- func (r *File) XXX_GraphQLType() string
- type FileExportOpts
- type FileID
- type GitOpts
- type GitRef
- type GitRefTreeOpts
- type GitRepository
- type HTTPOpts
- type Host
- type HostDirectoryOpts
- type ImageLayerCompression
- type ImageMediaTypes
- type Label
- type NetworkProtocol
- type PipelineLabel
- type PipelineOpts
- type Platform
- type Port
- type Project
- func (r *Project) Commands(ctx context.Context) ([]ProjectCommand, error)
- func (r *Project) ID(ctx context.Context) (ProjectID, error)
- func (r *Project) Load(source *Directory, configPath string) *Project
- func (r *Project) Name(ctx context.Context) (string, error)
- func (r *Project) With(f WithProjectFunc) *Project
- func (r *Project) XXX_GraphQLID(ctx context.Context) (string, error)
- func (r *Project) XXX_GraphQLIDType() string
- func (r *Project) XXX_GraphQLType() string
- type ProjectCommand
- func (r *ProjectCommand) Description(ctx context.Context) (string, error)
- func (r *ProjectCommand) Flags(ctx context.Context) ([]ProjectCommandFlag, error)
- func (r *ProjectCommand) ID(ctx context.Context) (ProjectCommandID, error)
- func (r *ProjectCommand) Name(ctx context.Context) (string, error)
- func (r *ProjectCommand) ResultType(ctx context.Context) (string, error)
- func (r *ProjectCommand) Subcommands(ctx context.Context) ([]ProjectCommand, error)
- func (r *ProjectCommand) XXX_GraphQLID(ctx context.Context) (string, error)
- func (r *ProjectCommand) XXX_GraphQLIDType() string
- func (r *ProjectCommand) XXX_GraphQLType() string
- type ProjectCommandFlag
- type ProjectCommandID
- type ProjectCommandOpts
- type ProjectID
- type ProjectOpts
- type Request
- type Response
- type Secret
- type SecretID
- type Socket
- type SocketID
- type SocketOpts
- type WithClientFunc
- type WithContainerFunc
- type WithDirectoryFunc
- type WithFileFunc
- type WithProjectFunc
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServeCommands ¶ added in v0.6.3
func ServeCommands(entrypoints ...any)
EXPERIMENTAL: ServeCommands is not intended for production use yet.
Types ¶
type BuildArg ¶ added in v0.4.3
type BuildArg struct { // The build argument name. Name string `json:"name"` // The build argument value. Value string `json:"value"` }
Key value object that represents a build argument.
type CacheSharingMode ¶ added in v0.4.5
type CacheSharingMode string
const ( Locked CacheSharingMode = "LOCKED" Private CacheSharingMode = "PRIVATE" )
type CacheVolume ¶
type CacheVolume struct {
// contains filtered or unexported fields
}
A directory whose contents persist across runs.
func (*CacheVolume) XXX_GraphQLID ¶ added in v0.4.0
func (r *CacheVolume) XXX_GraphQLID(ctx context.Context) (string, error)
XXX_GraphQLID is an internal function. It returns the underlying type ID
func (*CacheVolume) XXX_GraphQLIDType ¶ added in v0.7.2
func (r *CacheVolume) XXX_GraphQLIDType() string
XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (*CacheVolume) XXX_GraphQLType ¶ added in v0.4.0
func (r *CacheVolume) XXX_GraphQLType() string
XXX_GraphQLType is an internal function. It returns the native GraphQL type name
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the Dagger Engine Client
func (*Client) CacheVolume ¶ added in v0.4.4
func (r *Client) CacheVolume(key string) *CacheVolume
Constructs a cache volume for a given cache key.
func (*Client) CheckVersionCompatibility ¶ added in v0.8.0
Checks if the current Dagger Engine is compatible with an SDK's required version.
func (*Client) Container ¶ added in v0.4.4
func (r *Client) Container(opts ...ContainerOpts) *Container
Loads a container from ID.
Null ID returns an empty container (scratch). Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
func (*Client) DefaultPlatform ¶ added in v0.4.4
The default platform of the builder.
func (*Client) Directory ¶ added in v0.4.4
func (r *Client) Directory(opts ...DirectoryOpts) *Directory
Load a directory by ID. No argument produces an empty directory.
func (*Client) Git ¶ added in v0.4.4
func (r *Client) Git(url string, opts ...GitOpts) *GitRepository
Queries a git repository.
func (*Client) Pipeline ¶ added in v0.4.4
func (r *Client) Pipeline(name string, opts ...PipelineOpts) *Client
Creates a named sub-pipeline.
func (*Client) Project ¶ added in v0.4.4
func (r *Client) Project(opts ...ProjectOpts) *Project
Load a project from ID.
func (*Client) ProjectCommand ¶ added in v0.6.3
func (r *Client) ProjectCommand(opts ...ProjectCommandOpts) *ProjectCommand
Load a project command from ID.
func (*Client) SetSecret ¶ added in v0.5.1
Sets a secret given a user defined name to its plaintext and returns the secret. The plaintext value is limited to a size of 128000 bytes.
func (*Client) Socket ¶ added in v0.4.4
func (r *Client) Socket(opts ...SocketOpts) *Socket
Loads a socket by its ID.
func (*Client) With ¶ added in v0.7.4
func (r *Client) With(f WithClientFunc) *Client
With calls the provided function with current Client.
This is useful for reusability and readability by not breaking the calling chain.
type ClientOpt ¶
type ClientOpt interface {
// contains filtered or unexported methods
}
ClientOpt holds a client option
func WithConn ¶ added in v0.6.3
func WithConn(conn engineconn.EngineConn) ClientOpt
WithConn sets the engine connection explicitly
func WithLogOutput ¶
WithLogOutput sets the progress writer
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
An OCI-compatible container, also known as a docker container.
Example ¶
package main import ( "context" "fmt" "dagger.io/dagger" ) func main() { ctx := context.Background() client, err := dagger.Connect(ctx) if err != nil { panic(err) } defer client.Close() alpine := client.Container().From("alpine:3.16.2") out, err := alpine.WithExec([]string{"cat", "/etc/alpine-release"}).Stdout(ctx) if err != nil { panic(err) } fmt.Println(out) }
Output: 3.16.2
func (*Container) Build ¶
func (r *Container) Build(context *Directory, opts ...ContainerBuildOpts) *Container
Initializes this container from a Dockerfile build.
Example ¶
package main import ( "context" "fmt" "strings" "dagger.io/dagger" ) func main() { ctx := context.Background() client, err := dagger.Connect(ctx) if err != nil { panic(err) } defer client.Close() repo := client.Git("https://github.com/dagger/dagger"). Tag("v0.3.0"). Tree() daggerImg := client.Container().Build(repo) out, err := daggerImg.WithExec([]string{"version"}).Stdout(ctx) if err != nil { panic(err) } words := strings.Split(strings.TrimSpace(out), " ") fmt.Println(words[0]) }
Output: dagger
func (*Container) DefaultArgs ¶
Retrieves default arguments for future commands.
func (*Container) Endpoint ¶ added in v0.4.6
Retrieves an endpoint that clients can use to reach this container.
If no port is specified, the first exposed port is used. If none exist an error is returned.
If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
func (*Container) Entrypoint ¶
Retrieves entrypoint to be prepended to the arguments of all commands.
func (*Container) EnvVariable ¶
Retrieves the value of the specified environment variable.
func (*Container) EnvVariables ¶
func (r *Container) EnvVariables(ctx context.Context) ([]EnvVariable, error)
Retrieves the list of environment variables passed to commands.
func (*Container) Export ¶ added in v0.4.0
func (r *Container) Export(ctx context.Context, path string, opts ...ContainerExportOpts) (bool, error)
Writes the container as an OCI tarball to the destination file path on the host for the specified platform variants.
Return true on success. It can also publishes platform variants.
func (*Container) ExposedPorts ¶ added in v0.4.6
Retrieves the list of exposed ports.
This includes ports already exposed by the image, even if not explicitly added with dagger.
Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
func (*Container) Hostname ¶ added in v0.4.6
Retrieves a hostname which can be used by clients to reach this container.
Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
func (*Container) ID ¶
func (r *Container) ID(ctx context.Context) (ContainerID, error)
A unique identifier for this container.
func (*Container) ImageRef ¶ added in v0.4.6
The unique image reference which can only be retrieved immediately after the 'Container.From' call.
func (*Container) Import ¶ added in v0.6.0
func (r *Container) Import(source *File, opts ...ContainerImportOpts) *Container
Reads the container from an OCI tarball.
NOTE: this involves unpacking the tarball to an OCI store on the host at $XDG_CACHE_DIR/dagger/oci. This directory can be removed whenever you like.
func (*Container) Pipeline ¶ added in v0.4.4
func (r *Container) Pipeline(name string, opts ...ContainerPipelineOpts) *Container
Creates a named sub-pipeline
func (*Container) Publish ¶
func (r *Container) Publish(ctx context.Context, address string, opts ...ContainerPublishOpts) (string, error)
Publishes this container as a new image to the specified address.
Publish returns a fully qualified ref. It can also publish platform variants.
func (*Container) Rootfs ¶ added in v0.4.1
Retrieves this container's root filesystem. Mounts are not included.
func (*Container) Stderr ¶
The error stream of the last executed command.
Will execute default command if none is set, or error if there's no default.
func (*Container) Stdout ¶
The output stream of the last executed command.
Will execute default command if none is set, or error if there's no default.
func (*Container) Sync ¶ added in v0.6.3
Forces evaluation of the pipeline in the engine.
It doesn't run the default command if no exec has been set.
func (*Container) With ¶ added in v0.6.1
func (r *Container) With(f WithContainerFunc) *Container
With calls the provided function with current Container.
This is useful for reusability and readability by not breaking the calling chain.
Example ¶
package main import ( "context" "fmt" "dagger.io/dagger" ) func main() { ctx := context.Background() client, err := dagger.Connect(ctx) if err != nil { panic(err) } defer client.Close() alpine := client.Container().From("alpine:3.16.2"). With(func(c *dagger.Container) *dagger.Container { return c.WithEnvVariable("FOO", "bar") }) out, err := alpine.WithExec([]string{"printenv", "FOO"}).Stdout(ctx) if err != nil { panic(err) } fmt.Println(out) }
Output: bar
func (*Container) WithDefaultArgs ¶
func (r *Container) WithDefaultArgs(opts ...ContainerWithDefaultArgsOpts) *Container
Configures default arguments for future commands.
func (*Container) WithDirectory ¶ added in v0.4.2
func (r *Container) WithDirectory(path string, directory *Directory, opts ...ContainerWithDirectoryOpts) *Container
Retrieves this container plus a directory written at the given path.
func (*Container) WithEntrypoint ¶
Retrieves this container but with a different command entrypoint.
func (*Container) WithEnvVariable ¶
func (r *Container) WithEnvVariable(name string, value string, opts ...ContainerWithEnvVariableOpts) *Container
Retrieves this container plus the given environment variable.
Example ¶
package main import ( "context" "fmt" "dagger.io/dagger" ) func main() { ctx := context.Background() client, err := dagger.Connect(ctx) if err != nil { panic(err) } defer client.Close() out, err := client. Container(). From("alpine:3.16.2"). WithEnvVariable("FOO", "bar"). WithExec([]string{"sh", "-c", "echo $FOO"}). Stdout(ctx) if err != nil { panic(err) } fmt.Println(out) }
Output: bar
func (*Container) WithExec ¶ added in v0.4.1
func (r *Container) WithExec(args []string, opts ...ContainerWithExecOpts) *Container
Retrieves this container after executing the specified command inside it.
func (*Container) WithExposedPort ¶ added in v0.4.6
func (r *Container) WithExposedPort(port int, opts ...ContainerWithExposedPortOpts) *Container
Expose a network port.
Exposed ports serve two purposes:
- For health checks and introspection, when running services
- For setting the EXPOSE OCI field when publishing the container
Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
func (*Container) WithFile ¶ added in v0.4.2
func (r *Container) WithFile(path string, source *File, opts ...ContainerWithFileOpts) *Container
Retrieves this container plus the contents of the given file copied to the given path.
func (*Container) WithFocus ¶ added in v0.7.4
Indicate that subsequent operations should be featured more prominently in the UI.
func (*Container) WithMountedCache ¶
func (r *Container) WithMountedCache(path string, cache *CacheVolume, opts ...ContainerWithMountedCacheOpts) *Container
Retrieves this container plus a cache volume mounted at the given path.
Example ¶
package main import ( "context" "fmt" "strconv" "time" "dagger.io/dagger" ) func main() { ctx := context.Background() client, err := dagger.Connect(ctx) if err != nil { panic(err) } defer client.Close() cacheKey := "example-cache" cache := client.CacheVolume(cacheKey) container := client.Container().From("alpine:3.16.2") container = container.WithMountedCache("/cache", cache) filename := time.Now().Format("2006-01-02-15-04-05") echoCmd := fmt.Sprintf("echo $0 >> /cache/%[1]v.txt; cat /cache/%[1]v.txt", filename) var out string for i := 0; i < 5; i++ { out, err = container. WithExec([]string{"sh", "-c", echoCmd, strconv.Itoa(i)}). Stdout(ctx) if err != nil { panic(err) } } fmt.Printf("%q", out) }
Output: "0\n1\n2\n3\n4\n"
func (*Container) WithMountedDirectory ¶
func (r *Container) WithMountedDirectory(path string, source *Directory, opts ...ContainerWithMountedDirectoryOpts) *Container
Retrieves this container plus a directory mounted at the given path.
Example ¶
package main import ( "context" "fmt" "dagger.io/dagger" ) func main() { ctx := context.Background() client, err := dagger.Connect(ctx) if err != nil { panic(err) } defer client.Close() dir := client.Directory(). WithNewFile("hello.txt", "Hello, world!"). WithNewFile("goodbye.txt", "Goodbye, world!") out, err := client. Container(). From("alpine:3.16.2"). WithMountedDirectory("/mnt", dir). WithExec([]string{"ls", "/mnt"}). Stdout(ctx) if err != nil { panic(err) } fmt.Printf("%q", out) }
Output: "goodbye.txt\nhello.txt\n"
func (*Container) WithMountedFile ¶
func (r *Container) WithMountedFile(path string, source *File, opts ...ContainerWithMountedFileOpts) *Container
Retrieves this container plus a file mounted at the given path.
func (*Container) WithMountedSecret ¶
func (r *Container) WithMountedSecret(path string, source *Secret, opts ...ContainerWithMountedSecretOpts) *Container
Retrieves this container plus a secret mounted into a file at the given path.
func (*Container) WithMountedTemp ¶
Retrieves this container plus a temporary directory mounted at the given path.
func (*Container) WithNewFile ¶ added in v0.4.2
func (r *Container) WithNewFile(path string, opts ...ContainerWithNewFileOpts) *Container
Retrieves this container plus a new file written at the given path.
func (*Container) WithRegistryAuth ¶ added in v0.4.5
Retrieves this container with a registry authentication for a given address.
func (*Container) WithRootfs ¶ added in v0.4.1
Initializes this container from this DirectoryID.
func (*Container) WithSecretVariable ¶
Retrieves this container plus an env variable containing the given secret.
func (*Container) WithServiceBinding ¶ added in v0.4.6
Establish a runtime dependency on a service.
The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
The service will be reachable from the container via the provided hostname alias.
The service dependency will also convey to any files or directories produced by the container.
Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
func (*Container) WithUnixSocket ¶ added in v0.4.2
func (r *Container) WithUnixSocket(path string, source *Socket, opts ...ContainerWithUnixSocketOpts) *Container
Retrieves this container plus a socket forwarded to the given Unix socket path.
func (*Container) WithWorkdir ¶
Retrieves this container with a different working directory.
func (*Container) WithoutEnvVariable ¶
Retrieves this container minus the given environment variable.
func (*Container) WithoutExposedPort ¶ added in v0.4.6
func (r *Container) WithoutExposedPort(port int, opts ...ContainerWithoutExposedPortOpts) *Container
Unexpose a previously exposed port.
Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
func (*Container) WithoutFocus ¶ added in v0.7.4
Indicate that subsequent operations should not be featured more prominently in the UI.
This is the initial state of all containers.
func (*Container) WithoutLabel ¶ added in v0.4.4
Retrieves this container minus the given environment label.
func (*Container) WithoutMount ¶
Retrieves this container after unmounting everything at the given path.
func (*Container) WithoutRegistryAuth ¶ added in v0.4.5
Retrieves this container without the registry authentication of a given address.
func (*Container) WithoutUnixSocket ¶ added in v0.4.2
Retrieves this container with a previously added Unix socket removed.
func (*Container) XXX_GraphQLID ¶ added in v0.4.0
XXX_GraphQLID is an internal function. It returns the underlying type ID
func (*Container) XXX_GraphQLIDType ¶ added in v0.7.2
XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (*Container) XXX_GraphQLType ¶ added in v0.4.0
XXX_GraphQLType is an internal function. It returns the native GraphQL type name
type ContainerBuildOpts ¶
type ContainerBuildOpts struct { // Path to the Dockerfile to use. // // Default: './Dockerfile'. Dockerfile string // Additional build arguments. BuildArgs []BuildArg // Target build stage to build. Target string // Secrets to pass to the build. // // They will be mounted at /run/secrets/[secret-name] in the build container // // They can be accessed in the Dockerfile using the "secret" mount type // and mount path /run/secrets/[secret-name] // e.g. RUN --mount=type=secret,id=my-secret curl url?token=$(cat /run/secrets/my-secret)" Secrets []*Secret }
ContainerBuildOpts contains options for Container.Build
type ContainerEndpointOpts ¶ added in v0.4.6
type ContainerEndpointOpts struct { // The exposed port number for the endpoint Port int // Return a URL with the given scheme, eg. http for http:// Scheme string }
ContainerEndpointOpts contains options for Container.Endpoint
type ContainerExportOpts ¶ added in v0.4.0
type ContainerExportOpts struct { // Identifiers for other platform specific containers. // Used for multi-platform image. PlatformVariants []*Container // Force each layer of the exported image to use the specified compression algorithm. // If this is unset, then if a layer already has a compressed blob in the engine's // cache, that will be used (this can result in a mix of compression algorithms for // different layers). If this is unset and a layer has no compressed blob in the // engine's cache, then it will be compressed using Gzip. ForcedCompression ImageLayerCompression // Use the specified media types for the exported image's layers. Defaults to OCI, which // is largely compatible with most recent container runtimes, but Docker may be needed // for older runtimes without OCI support. MediaTypes ImageMediaTypes }
ContainerExportOpts contains options for Container.Export
type ContainerID ¶
type ContainerID string
A unique container identifier. Null designates an empty container (scratch).
type ContainerImportOpts ¶ added in v0.6.0
type ContainerImportOpts struct { // Identifies the tag to import from the archive, if the archive bundles // multiple tags. Tag string }
ContainerImportOpts contains options for Container.Import
type ContainerOpts ¶
type ContainerOpts struct { ID ContainerID Platform Platform }
ContainerOpts contains options for Client.Container
type ContainerPipelineOpts ¶ added in v0.4.4
type ContainerPipelineOpts struct { // Pipeline description. Description string // Pipeline labels. Labels []PipelineLabel }
ContainerPipelineOpts contains options for Container.Pipeline
type ContainerPublishOpts ¶ added in v0.4.0
type ContainerPublishOpts struct { // Identifiers for other platform specific containers. // Used for multi-platform image. PlatformVariants []*Container // Force each layer of the published image to use the specified compression algorithm. // If this is unset, then if a layer already has a compressed blob in the engine's // cache, that will be used (this can result in a mix of compression algorithms for // different layers). If this is unset and a layer has no compressed blob in the // engine's cache, then it will be compressed using Gzip. ForcedCompression ImageLayerCompression // Use the specified media types for the published image's layers. Defaults to OCI, which // is largely compatible with most recent registries, but Docker may be needed for older // registries without OCI support. MediaTypes ImageMediaTypes }
ContainerPublishOpts contains options for Container.Publish
type ContainerWithDefaultArgsOpts ¶
type ContainerWithDefaultArgsOpts struct { // Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]). Args []string }
ContainerWithDefaultArgsOpts contains options for Container.WithDefaultArgs
type ContainerWithDirectoryOpts ¶ added in v0.4.2
type ContainerWithDirectoryOpts struct { // Patterns to exclude in the written directory (e.g., ["node_modules/**", ".gitignore", ".git/"]). Exclude []string // Patterns to include in the written directory (e.g., ["*.go", "go.mod", "go.sum"]). Include []string // A user:group to set for the directory and its contents. // // The user and group can either be an ID (1000:1000) or a name (foo:bar). // // If the group is omitted, it defaults to the same as the user. Owner string }
ContainerWithDirectoryOpts contains options for Container.WithDirectory
type ContainerWithEnvVariableOpts ¶ added in v0.7.0
type ContainerWithEnvVariableOpts struct { // Replace ${VAR} or $VAR in the value according to the current environment // variables defined in the container (e.g., "/opt/bin:$PATH"). Expand bool }
ContainerWithEnvVariableOpts contains options for Container.WithEnvVariable
type ContainerWithExecOpts ¶ added in v0.4.1
type ContainerWithExecOpts struct { // If the container has an entrypoint, ignore it for args rather than using it to wrap them. SkipEntrypoint bool // Content to write to the command's standard input before closing (e.g., "Hello world"). Stdin string // Redirect the command's standard output to a file in the container (e.g., "/tmp/stdout"). RedirectStdout string // Redirect the command's standard error to a file in the container (e.g., "/tmp/stderr"). RedirectStderr string // Provides dagger access to the executed command. // // Do not use this option unless you trust the command being executed. // The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM. ExperimentalPrivilegedNesting bool // Execute the command with all root capabilities. This is similar to running a command // with "sudo" or executing `docker run` with the `--privileged` flag. Containerization // does not provide any security guarantees when using this option. It should only be used // when absolutely necessary and only with trusted commands. InsecureRootCapabilities bool }
ContainerWithExecOpts contains options for Container.WithExec
type ContainerWithExposedPortOpts ¶ added in v0.4.6
type ContainerWithExposedPortOpts struct { // Transport layer network protocol Protocol NetworkProtocol // Optional port description Description string }
ContainerWithExposedPortOpts contains options for Container.WithExposedPort
type ContainerWithFileOpts ¶ added in v0.4.3
type ContainerWithFileOpts struct { // Permission given to the copied file (e.g., 0600). // // Default: 0644. Permissions int // A user:group to set for the file. // // The user and group can either be an ID (1000:1000) or a name (foo:bar). // // If the group is omitted, it defaults to the same as the user. Owner string }
ContainerWithFileOpts contains options for Container.WithFile
type ContainerWithMountedCacheOpts ¶
type ContainerWithMountedCacheOpts struct { // Identifier of the directory to use as the cache volume's root. Source *Directory // Sharing mode of the cache volume. Sharing CacheSharingMode // A user:group to set for the mounted cache directory. // // Note that this changes the ownership of the specified mount along with the // initial filesystem provided by source (if any). It does not have any effect // if/when the cache has already been created. // // The user and group can either be an ID (1000:1000) or a name (foo:bar). // // If the group is omitted, it defaults to the same as the user. Owner string }
ContainerWithMountedCacheOpts contains options for Container.WithMountedCache
type ContainerWithMountedDirectoryOpts ¶ added in v0.6.1
type ContainerWithMountedDirectoryOpts struct { // A user:group to set for the mounted directory and its contents. // // The user and group can either be an ID (1000:1000) or a name (foo:bar). // // If the group is omitted, it defaults to the same as the user. Owner string }
ContainerWithMountedDirectoryOpts contains options for Container.WithMountedDirectory
type ContainerWithMountedFileOpts ¶ added in v0.6.1
type ContainerWithMountedFileOpts struct { // A user or user:group to set for the mounted file. // // The user and group can either be an ID (1000:1000) or a name (foo:bar). // // If the group is omitted, it defaults to the same as the user. Owner string }
ContainerWithMountedFileOpts contains options for Container.WithMountedFile
type ContainerWithMountedSecretOpts ¶ added in v0.6.1
type ContainerWithMountedSecretOpts struct { // A user:group to set for the mounted secret. // // The user and group can either be an ID (1000:1000) or a name (foo:bar). // // If the group is omitted, it defaults to the same as the user. Owner string // Permission given to the mounted secret (e.g., 0600). // This option requires an owner to be set to be active. // // Default: 0400. Mode int }
ContainerWithMountedSecretOpts contains options for Container.WithMountedSecret
type ContainerWithNewFileOpts ¶ added in v0.4.2
type ContainerWithNewFileOpts struct { // Content of the file to write (e.g., "Hello world!"). Contents string // Permission given to the written file (e.g., 0600). // // Default: 0644. Permissions int // A user:group to set for the file. // // The user and group can either be an ID (1000:1000) or a name (foo:bar). // // If the group is omitted, it defaults to the same as the user. Owner string }
ContainerWithNewFileOpts contains options for Container.WithNewFile
type ContainerWithUnixSocketOpts ¶ added in v0.6.1
type ContainerWithUnixSocketOpts struct { // A user:group to set for the mounted socket. // // The user and group can either be an ID (1000:1000) or a name (foo:bar). // // If the group is omitted, it defaults to the same as the user. Owner string }
ContainerWithUnixSocketOpts contains options for Container.WithUnixSocket
type ContainerWithoutExposedPortOpts ¶ added in v0.4.6
type ContainerWithoutExposedPortOpts struct { // Port protocol to unexpose Protocol NetworkProtocol }
ContainerWithoutExposedPortOpts contains options for Container.WithoutExposedPort
type Directory ¶
type Directory struct {
// contains filtered or unexported fields
}
A directory.
Example ¶
package main import ( "context" "fmt" "dagger.io/dagger" ) func main() { ctx := context.Background() client, err := dagger.Connect(ctx) if err != nil { panic(err) } defer client.Close() dir := client.Directory(). WithNewFile("hello.txt", "Hello, world!"). WithNewFile("goodbye.txt", "Goodbye, world!") entries, err := dir.Entries(ctx) if err != nil { panic(err) } fmt.Println(entries) }
Output: [goodbye.txt hello.txt]
func (*Directory) DockerBuild ¶ added in v0.4.2
func (r *Directory) DockerBuild(opts ...DirectoryDockerBuildOpts) *Container
Builds a new Docker container from this directory.
func (*Directory) Export ¶ added in v0.4.0
Writes the contents of the directory to a path on the host.
func (*Directory) ID ¶
func (r *Directory) ID(ctx context.Context) (DirectoryID, error)
The content-addressed identifier of the directory.
func (*Directory) Pipeline ¶ added in v0.4.4
func (r *Directory) Pipeline(name string, opts ...DirectoryPipelineOpts) *Directory
Creates a named sub-pipeline
func (*Directory) With ¶ added in v0.6.1
func (r *Directory) With(f WithDirectoryFunc) *Directory
With calls the provided function with current Directory.
This is useful for reusability and readability by not breaking the calling chain.
func (*Directory) WithDirectory ¶
func (r *Directory) WithDirectory(path string, directory *Directory, opts ...DirectoryWithDirectoryOpts) *Directory
Retrieves this directory plus a directory written at the given path.
func (*Directory) WithFile ¶ added in v0.4.0
func (r *Directory) WithFile(path string, source *File, opts ...DirectoryWithFileOpts) *Directory
Retrieves this directory plus the contents of the given file copied to the given path.
func (*Directory) WithNewDirectory ¶ added in v0.4.0
func (r *Directory) WithNewDirectory(path string, opts ...DirectoryWithNewDirectoryOpts) *Directory
Retrieves this directory plus a new directory created at the given path.
func (*Directory) WithNewFile ¶
func (r *Directory) WithNewFile(path string, contents string, opts ...DirectoryWithNewFileOpts) *Directory
Retrieves this directory plus a new file written at the given path.
func (*Directory) WithTimestamps ¶ added in v0.4.3
Retrieves this directory with all file/dir timestamps set to the given time.
func (*Directory) WithoutDirectory ¶
Retrieves this directory with the directory at the given path removed.
func (*Directory) WithoutFile ¶
Retrieves this directory with the file at the given path removed.
func (*Directory) XXX_GraphQLID ¶ added in v0.4.0
XXX_GraphQLID is an internal function. It returns the underlying type ID
func (*Directory) XXX_GraphQLIDType ¶ added in v0.7.2
XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (*Directory) XXX_GraphQLType ¶ added in v0.4.0
XXX_GraphQLType is an internal function. It returns the native GraphQL type name
type DirectoryDockerBuildOpts ¶ added in v0.4.2
type DirectoryDockerBuildOpts struct { // Path to the Dockerfile to use (e.g., "frontend.Dockerfile"). // // Defaults: './Dockerfile'. Dockerfile string // The platform to build. Platform Platform // Build arguments to use in the build. BuildArgs []BuildArg // Target build stage to build. Target string // Secrets to pass to the build. // // They will be mounted at /run/secrets/[secret-name]. Secrets []*Secret }
DirectoryDockerBuildOpts contains options for Directory.DockerBuild
type DirectoryEntriesOpts ¶
type DirectoryEntriesOpts struct { // Location of the directory to look at (e.g., "/src"). Path string }
DirectoryEntriesOpts contains options for Directory.Entries
type DirectoryOpts ¶
type DirectoryOpts struct {
ID DirectoryID
}
DirectoryOpts contains options for Client.Directory
type DirectoryPipelineOpts ¶ added in v0.4.4
type DirectoryPipelineOpts struct { // Pipeline description. Description string // Pipeline labels. Labels []PipelineLabel }
DirectoryPipelineOpts contains options for Directory.Pipeline
type DirectoryWithDirectoryOpts ¶ added in v0.4.0
type DirectoryWithDirectoryOpts struct { // Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]). Exclude []string // Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]). Include []string }
DirectoryWithDirectoryOpts contains options for Directory.WithDirectory
type DirectoryWithFileOpts ¶ added in v0.4.3
type DirectoryWithFileOpts struct { // Permission given to the copied file (e.g., 0600). // // Default: 0644. Permissions int }
DirectoryWithFileOpts contains options for Directory.WithFile
type DirectoryWithNewDirectoryOpts ¶ added in v0.4.3
type DirectoryWithNewDirectoryOpts struct { // Permission granted to the created directory (e.g., 0777). // // Default: 0755. Permissions int }
DirectoryWithNewDirectoryOpts contains options for Directory.WithNewDirectory
type DirectoryWithNewFileOpts ¶
type DirectoryWithNewFileOpts struct { // Permission given to the copied file (e.g., 0600). // // Default: 0644. Permissions int }
DirectoryWithNewFileOpts contains options for Directory.WithNewFile
type EnvVariable ¶
type EnvVariable struct {
// contains filtered or unexported fields
}
A simple key value object that represents an environment variable.
type ExecError ¶ added in v0.7.0
type ExecError struct { Cmd []string ExitCode int Stdout string Stderr string // contains filtered or unexported fields }
ExecError is an API error from an exec operation.
type File ¶
type File struct {
// contains filtered or unexported fields
}
A file.
func (*File) With ¶ added in v0.7.4
func (r *File) With(f WithFileFunc) *File
With calls the provided function with current File.
This is useful for reusability and readability by not breaking the calling chain.
func (*File) WithTimestamps ¶ added in v0.4.3
Retrieves this file with its created/modified timestamps set to the given time.
func (*File) XXX_GraphQLID ¶ added in v0.4.0
XXX_GraphQLID is an internal function. It returns the underlying type ID
func (*File) XXX_GraphQLIDType ¶ added in v0.7.2
XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (*File) XXX_GraphQLType ¶ added in v0.4.0
XXX_GraphQLType is an internal function. It returns the native GraphQL type name
type FileExportOpts ¶ added in v0.7.2
type FileExportOpts struct { // If allowParentDirPath is true, the path argument can be a directory path, in which case // the file will be created in that directory. AllowParentDirPath bool }
FileExportOpts contains options for File.Export
type GitOpts ¶ added in v0.4.1
type GitOpts struct { // Set to true to keep .git directory. KeepGitDir bool // A service which must be started before the repo is fetched. ExperimentalServiceHost *Container }
GitOpts contains options for Client.Git
type GitRef ¶
type GitRef struct {
// contains filtered or unexported fields
}
A git ref (tag, branch or commit).
func (*GitRef) Tree ¶
func (r *GitRef) Tree(opts ...GitRefTreeOpts) *Directory
The filesystem tree at this ref.
type GitRefTreeOpts ¶ added in v0.4.2
GitRefTreeOpts contains options for GitRef.Tree
type GitRepository ¶
type GitRepository struct {
// contains filtered or unexported fields
}
A git repository.
Example ¶
package main import ( "context" "fmt" "strings" "dagger.io/dagger" ) func main() { ctx := context.Background() client, err := dagger.Connect(ctx) if err != nil { panic(err) } defer client.Close() readme, err := client.Git("https://github.com/dagger/dagger"). Tag("v0.3.0"). Tree().File("README.md").Contents(ctx) if err != nil { panic(err) } lines := strings.Split(strings.TrimSpace(readme), "\n") fmt.Println(lines[0]) }
Output: ## What is Dagger?
func (*GitRepository) Branch ¶
func (r *GitRepository) Branch(name string) *GitRef
Returns details on one branch.
func (*GitRepository) Commit ¶ added in v0.4.1
func (r *GitRepository) Commit(id string) *GitRef
Returns details on one commit.
func (*GitRepository) Tag ¶
func (r *GitRepository) Tag(name string) *GitRef
Returns details on one tag.
type HTTPOpts ¶ added in v0.4.6
type HTTPOpts struct { // A service which must be started before the URL is fetched. ExperimentalServiceHost *Container }
HTTPOpts contains options for Client.HTTP
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
Information about the host execution environment.
func (*Host) Directory ¶
func (r *Host) Directory(path string, opts ...HostDirectoryOpts) *Directory
Accesses a directory on the host.
Example ¶
package main import ( "context" "fmt" "strings" "dagger.io/dagger" ) func main() { ctx := context.Background() client, err := dagger.Connect(ctx, dagger.WithWorkdir(".")) if err != nil { panic(err) } defer client.Close() readme, err := client.Host().Directory(".").File("README.md").Contents(ctx) if err != nil { panic(err) } fmt.Printf("%v\n", strings.Contains(readme, "Dagger")) }
Output: true
func (*Host) SetSecretFile ¶ added in v0.8.0
Sets a secret given a user-defined name and the file path on the host, and returns the secret. The file is limited to a size of 512000 bytes.
func (*Host) UnixSocket ¶ added in v0.4.2
Accesses a Unix socket on the host.
type HostDirectoryOpts ¶ added in v0.4.0
type HostDirectoryOpts struct { // Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]). Exclude []string // Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]). Include []string }
HostDirectoryOpts contains options for Host.Directory
type ImageLayerCompression ¶ added in v0.6.3
type ImageLayerCompression string
const ( Estargz ImageLayerCompression = "EStarGZ" Gzip ImageLayerCompression = "Gzip" Uncompressed ImageLayerCompression = "Uncompressed" Zstd ImageLayerCompression = "Zstd" )
type ImageMediaTypes ¶ added in v0.7.4
type ImageMediaTypes string
const ( Dockermediatypes ImageMediaTypes = "DockerMediaTypes" Ocimediatypes ImageMediaTypes = "OCIMediaTypes" )
type Label ¶ added in v0.4.4
type Label struct {
// contains filtered or unexported fields
}
A simple key value object that represents a label.
type NetworkProtocol ¶ added in v0.4.6
type NetworkProtocol string
const ( Tcp NetworkProtocol = "TCP" Udp NetworkProtocol = "UDP" )
type PipelineLabel ¶ added in v0.5.0
type PipelineLabel struct { // Label name. Name string `json:"name"` // Label value. Value string `json:"value"` }
Key value object that represents a Pipeline label.
type PipelineOpts ¶ added in v0.4.4
type PipelineOpts struct { // Pipeline description. Description string // Pipeline labels. Labels []PipelineLabel }
PipelineOpts contains options for Client.Pipeline
type Platform ¶ added in v0.4.0
type Platform string
The platform config OS and architecture in a Container.
The format is os/[platform]/[version] (e.g., "darwin/arm64/v7", "windows/amd64", "linux/arm64").
type Port ¶ added in v0.4.6
type Port struct {
// contains filtered or unexported fields
}
A port exposed by a container.
func (*Port) Description ¶ added in v0.4.6
The port description.
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
A collection of Dagger resources that can be queried and invoked.
func (*Project) Commands ¶ added in v0.6.3
func (r *Project) Commands(ctx context.Context) ([]ProjectCommand, error)
Commands provided by this project
func (*Project) Load ¶ added in v0.6.3
Initialize this project from the given directory and config path
func (*Project) With ¶ added in v0.7.4
func (r *Project) With(f WithProjectFunc) *Project
With calls the provided function with current Project.
This is useful for reusability and readability by not breaking the calling chain.
func (*Project) XXX_GraphQLID ¶ added in v0.6.3
XXX_GraphQLID is an internal function. It returns the underlying type ID
func (*Project) XXX_GraphQLIDType ¶ added in v0.7.2
XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (*Project) XXX_GraphQLType ¶ added in v0.6.3
XXX_GraphQLType is an internal function. It returns the native GraphQL type name
type ProjectCommand ¶ added in v0.6.3
type ProjectCommand struct {
// contains filtered or unexported fields
}
A command defined in a project that can be invoked from the CLI.
func (*ProjectCommand) Description ¶ added in v0.6.3
func (r *ProjectCommand) Description(ctx context.Context) (string, error)
Documentation for what this command does.
func (*ProjectCommand) Flags ¶ added in v0.6.3
func (r *ProjectCommand) Flags(ctx context.Context) ([]ProjectCommandFlag, error)
Flags accepted by this command.
func (*ProjectCommand) ID ¶ added in v0.6.3
func (r *ProjectCommand) ID(ctx context.Context) (ProjectCommandID, error)
A unique identifier for this command.
func (*ProjectCommand) Name ¶ added in v0.6.3
func (r *ProjectCommand) Name(ctx context.Context) (string, error)
The name of the command.
func (*ProjectCommand) ResultType ¶ added in v0.7.2
func (r *ProjectCommand) ResultType(ctx context.Context) (string, error)
The name of the type returned by this command.
func (*ProjectCommand) Subcommands ¶ added in v0.6.3
func (r *ProjectCommand) Subcommands(ctx context.Context) ([]ProjectCommand, error)
Subcommands, if any, that this command provides.
func (*ProjectCommand) XXX_GraphQLID ¶ added in v0.6.3
func (r *ProjectCommand) XXX_GraphQLID(ctx context.Context) (string, error)
XXX_GraphQLID is an internal function. It returns the underlying type ID
func (*ProjectCommand) XXX_GraphQLIDType ¶ added in v0.7.2
func (r *ProjectCommand) XXX_GraphQLIDType() string
XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (*ProjectCommand) XXX_GraphQLType ¶ added in v0.6.3
func (r *ProjectCommand) XXX_GraphQLType() string
XXX_GraphQLType is an internal function. It returns the native GraphQL type name
type ProjectCommandFlag ¶ added in v0.6.3
type ProjectCommandFlag struct {
// contains filtered or unexported fields
}
A flag accepted by a project command.
func (*ProjectCommandFlag) Description ¶ added in v0.6.3
func (r *ProjectCommandFlag) Description(ctx context.Context) (string, error)
Documentation for what this flag sets.
type ProjectCommandID ¶ added in v0.6.3
type ProjectCommandID string
A unique project command identifier.
type ProjectCommandOpts ¶ added in v0.6.3
type ProjectCommandOpts struct {
ID ProjectCommandID
}
ProjectCommandOpts contains options for Client.ProjectCommand
type ProjectOpts ¶ added in v0.6.3
type ProjectOpts struct {
ID ProjectID
}
ProjectOpts contains options for Client.Project
type Request ¶
type Request struct { // The literal string representing the GraphQL query, e.g. // `query myQuery { myField }`. Query string `json:"query"` // A JSON-marshalable value containing the variables to be sent // along with the query, or nil if there are none. Variables interface{} `json:"variables,omitempty"` // The GraphQL operation name. The server typically doesn't // require this unless there are multiple queries in the // document, but genqlient sets it unconditionally anyway. OpName string `json:"operationName"` }
Request contains all the values required to build queries executed by the graphql.Client.
Typically, GraphQL APIs will accept a JSON payload of the form
{"query": "query myQuery { ... }", "variables": {...}}`
and Request marshals to this format. However, MakeRequest may marshal the data in some other way desired by the backend.
type Response ¶
type Response struct { Data interface{} `json:"data"` Extensions map[string]interface{} `json:"extensions,omitempty"` Errors gqlerror.List `json:"errors,omitempty"` }
Response that contains data returned by the GraphQL API.
Typically, GraphQL APIs will return a JSON payload of the form
{"data": {...}, "errors": {...}}
It may additionally contain a key named "extensions", that might hold GraphQL protocol extensions. Extensions and Errors are optional, depending on the values returned by the server.
type Secret ¶
type Secret struct {
// contains filtered or unexported fields
}
A reference to a secret value, which can be handled more safely than the value itself.
func (*Secret) XXX_GraphQLID ¶ added in v0.4.0
XXX_GraphQLID is an internal function. It returns the underlying type ID
func (*Secret) XXX_GraphQLIDType ¶ added in v0.7.2
XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (*Secret) XXX_GraphQLType ¶ added in v0.4.0
XXX_GraphQLType is an internal function. It returns the native GraphQL type name
type Socket ¶ added in v0.4.2
type Socket struct {
// contains filtered or unexported fields
}
func (*Socket) XXX_GraphQLID ¶ added in v0.4.2
XXX_GraphQLID is an internal function. It returns the underlying type ID
func (*Socket) XXX_GraphQLIDType ¶ added in v0.7.2
XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (*Socket) XXX_GraphQLType ¶ added in v0.4.2
XXX_GraphQLType is an internal function. It returns the native GraphQL type name
type SocketOpts ¶ added in v0.4.2
type SocketOpts struct {
ID SocketID
}
SocketOpts contains options for Client.Socket