Documentation ¶
Index ¶
- func Serve(server any)
- type CacheID
- type CacheVolume
- type Client
- type ClientOpt
- type Container
- func (r *Container) Build(context DirectoryID, opts ...ContainerBuildOpts) *Container
- func (r *Container) DefaultArgs(ctx context.Context) ([]string, error)
- func (r *Container) Directory(path string) *Directory
- 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) Exec(opts ...ContainerExecOpts) *Container
- func (r *Container) ExitCode(ctx context.Context) (int, error)
- func (r *Container) FS() *Directory
- func (r *Container) File(path string) *File
- func (r *Container) From(address string) *Container
- func (r *Container) ID(ctx context.Context) (ContainerID, error)
- func (r *Container) Mounts(ctx context.Context) ([]string, error)
- func (r *Container) Publish(ctx context.Context, address string) (string, error)
- func (r *Container) Stderr() *File
- func (r *Container) Stdout() *File
- func (r *Container) User(ctx context.Context) (string, error)
- func (r *Container) WithDefaultArgs(opts ...ContainerWithDefaultArgsOpts) *Container
- func (r *Container) WithEntrypoint(args []string) *Container
- func (r *Container) WithEnvVariable(name string, value string) *Container
- func (r *Container) WithFS(id DirectoryID) *Container
- func (r *Container) WithMountedCache(cache CacheID, path string, opts ...ContainerWithMountedCacheOpts) *Container
- func (r *Container) WithMountedDirectory(path string, source DirectoryID) *Container
- func (r *Container) WithMountedFile(path string, source FileID) *Container
- func (r *Container) WithMountedSecret(path string, source SecretID) *Container
- func (r *Container) WithMountedTemp(path string) *Container
- func (r *Container) WithSecretVariable(name string, secret SecretID) *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) WithoutMount(path string) *Container
- func (r *Container) Workdir(ctx context.Context) (string, error)
- type ContainerBuildOpts
- type ContainerExecOpts
- type ContainerID
- type ContainerOpts
- type ContainerWithDefaultArgsOpts
- type ContainerWithMountedCacheOpts
- type Directory
- func (r *Directory) Diff(other DirectoryID) *Directory
- func (r *Directory) Directory(path string) *Directory
- func (r *Directory) Entries(ctx context.Context, opts ...DirectoryEntriesOpts) ([]string, error)
- func (r *Directory) File(path string) *File
- func (r *Directory) ID(ctx context.Context) (DirectoryID, error)
- func (r *Directory) LoadProject(configPath string) *Project
- func (r *Directory) WithCopiedFile(path string, source FileID) *Directory
- func (r *Directory) WithDirectory(directory DirectoryID, path string) *Directory
- func (r *Directory) WithNewFile(path string, opts ...DirectoryWithNewFileOpts) *Directory
- func (r *Directory) WithoutDirectory(path string) *Directory
- func (r *Directory) WithoutFile(path string) *Directory
- type DirectoryEntriesOpts
- type DirectoryID
- type DirectoryOpts
- type DirectoryWithNewFileOpts
- type EnvVariable
- type File
- type FileID
- type GitRef
- type GitRepository
- type Host
- type HostDirectory
- type HostDirectoryID
- type HostDirectoryWriteOpts
- type HostVariable
- type Project
- func (r *Project) Extensions(ctx context.Context) ([]Project, error)
- func (r *Project) GeneratedCode() *Directory
- func (r *Project) Install(ctx context.Context) (bool, error)
- func (r *Project) Name(ctx context.Context) (string, error)
- func (r *Project) SDK(ctx context.Context) (string, error)
- func (r *Project) Schema(ctx context.Context) (string, error)
- type Query
- func (r *Query) CacheVolume(key string) *CacheVolume
- func (r *Query) Container(opts ...ContainerOpts) *Container
- func (r *Query) Directory(opts ...DirectoryOpts) *Directory
- func (r *Query) File(id FileID) *File
- func (r *Query) Git(url string) *GitRepository
- func (r *Query) HTTP(url string) *File
- func (r *Query) Host() *Host
- func (r *Query) Project(name string) *Project
- func (r *Query) Secret(id SecretID) *Secret
- type Request
- type Response
- type Secret
- type SecretID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CacheID ¶
type CacheID string
A global cache volume identifier
func (CacheID) GraphQLMarshal ¶
GraphQLMarshal serializes the structure into GraphQL
func (CacheID) GraphQLType ¶
GraphQLType returns the native GraphQL type name
type CacheVolume ¶
type CacheVolume struct {
// contains filtered or unexported fields
}
A directory whose contents persist across runs
type Client ¶
type Client struct { Query // contains filtered or unexported fields }
Client is the Dagger Engine Client
type ClientOpt ¶
type ClientOpt interface {
// contains filtered or unexported methods
}
ClientOpt holds a client option
func WithConfigPath ¶
WithConfigPath sets the engine config path
func WithLocalDir ¶
WithLocalDir maps a local directory to the engine
func WithLogOutput ¶
WithLogOutput sets the progress writer
func WithNoExtensions ¶
func WithNoExtensions() ClientOpt
WithNoExtensions disables installing extensions
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
An OCI-compatible container, also known as a docker container
func (*Container) Build ¶
func (r *Container) Build(context DirectoryID, opts ...ContainerBuildOpts) *Container
Initialize this container from a Dockerfile build
func (*Container) DefaultArgs ¶
Default arguments for future commands
func (*Container) Entrypoint ¶
Entrypoint to be prepended to the arguments of all commands
func (*Container) EnvVariable ¶
The value of the specified environment variable
func (*Container) EnvVariables ¶
func (r *Container) EnvVariables(ctx context.Context) ([]EnvVariable, error)
A list of environment variables passed to commands
func (*Container) Exec ¶
func (r *Container) Exec(opts ...ContainerExecOpts) *Container
This container after executing the specified command inside it
func (*Container) ExitCode ¶
Exit code of the last executed command. Zero means success. Null if no command has been executed.
func (*Container) From ¶
Initialize this container from the base image published at the given address
func (*Container) ID ¶
func (r *Container) ID(ctx context.Context) (ContainerID, error)
A unique identifier for this container
func (*Container) Stderr ¶
The error stream of the last executed command. Null if no command has been executed.
func (*Container) Stdout ¶
The output stream of the last executed command. Null if no command has been executed.
func (*Container) WithDefaultArgs ¶
func (r *Container) WithDefaultArgs(opts ...ContainerWithDefaultArgsOpts) *Container
Configures default arguments for future commands
func (*Container) WithEntrypoint ¶
This container but with a different command entrypoint
func (*Container) WithEnvVariable ¶
This container plus the given environment variable
func (*Container) WithFS ¶
func (r *Container) WithFS(id DirectoryID) *Container
Initialize this container from this DirectoryID
func (*Container) WithMountedCache ¶
func (r *Container) WithMountedCache(cache CacheID, path string, opts ...ContainerWithMountedCacheOpts) *Container
This container plus a cache volume mounted at the given path
func (*Container) WithMountedDirectory ¶
func (r *Container) WithMountedDirectory(path string, source DirectoryID) *Container
This container plus a directory mounted at the given path
func (*Container) WithMountedFile ¶
This container plus a file mounted at the given path
func (*Container) WithMountedSecret ¶
This container plus a secret mounted into a file at the given path
func (*Container) WithMountedTemp ¶
This container plus a temporary directory mounted at the given path
func (*Container) WithSecretVariable ¶
This container plus an env variable containing the given secret
func (*Container) WithWorkdir ¶
This container but with a different working directory
func (*Container) WithoutEnvVariable ¶
This container minus the given environment variable
func (*Container) WithoutMount ¶
This container after unmounting everything at the given path.
type ContainerBuildOpts ¶
type ContainerBuildOpts struct {
Dockerfile string
}
ContainerBuildOpts contains options for Container.Build
type ContainerExecOpts ¶
type ContainerExecOpts struct { Args []string RedirectStderr string RedirectStdout string Stdin string }
ContainerExecOpts contains options for Container.Exec
type ContainerID ¶
type ContainerID string
A unique container identifier. Null designates an empty container (scratch).
func (ContainerID) GraphQLMarshal ¶
func (s ContainerID) GraphQLMarshal(ctx context.Context) (any, error)
GraphQLMarshal serializes the structure into GraphQL
func (ContainerID) GraphQLType ¶
func (s ContainerID) GraphQLType() string
GraphQLType returns the native GraphQL type name
type ContainerOpts ¶
type ContainerOpts struct {
ID ContainerID
}
ContainerOpts contains options for Query.Container
type ContainerWithDefaultArgsOpts ¶
type ContainerWithDefaultArgsOpts struct {
Args []string
}
ContainerWithDefaultArgsOpts contains options for Container.WithDefaultArgs
type ContainerWithMountedCacheOpts ¶
type ContainerWithMountedCacheOpts struct {
Source DirectoryID
}
ContainerWithMountedCacheOpts contains options for Container.WithMountedCache
type Directory ¶
type Directory struct {
// contains filtered or unexported fields
}
A directory
func (*Directory) Diff ¶
func (r *Directory) Diff(other DirectoryID) *Directory
The difference between this directory and an another directory
func (*Directory) ID ¶
func (r *Directory) ID(ctx context.Context) (DirectoryID, error)
The content-addressed identifier of the directory
func (*Directory) LoadProject ¶
load a project's metadata
func (*Directory) WithCopiedFile ¶
This directory plus the contents of the given file copied to the given path
func (*Directory) WithDirectory ¶
func (r *Directory) WithDirectory(directory DirectoryID, path string) *Directory
This directory plus a directory written at the given path
func (*Directory) WithNewFile ¶
func (r *Directory) WithNewFile(path string, opts ...DirectoryWithNewFileOpts) *Directory
This directory plus a new file written at the given path
func (*Directory) WithoutDirectory ¶
This directory with the directory at the given path removed
func (*Directory) WithoutFile ¶
This directory with the file at the given path removed
type DirectoryEntriesOpts ¶
type DirectoryEntriesOpts struct {
Path string
}
DirectoryEntriesOpts contains options for Directory.Entries
type DirectoryID ¶
type DirectoryID string
A content-addressed directory identifier
func (DirectoryID) GraphQLMarshal ¶
func (s DirectoryID) GraphQLMarshal(ctx context.Context) (any, error)
GraphQLMarshal serializes the structure into GraphQL
func (DirectoryID) GraphQLType ¶
func (s DirectoryID) GraphQLType() string
GraphQLType returns the native GraphQL type name
type DirectoryOpts ¶
type DirectoryOpts struct {
ID DirectoryID
}
DirectoryOpts contains options for Query.Directory
type DirectoryWithNewFileOpts ¶
type DirectoryWithNewFileOpts struct {
Contents string
}
DirectoryWithNewFileOpts contains options for Directory.WithNewFile
type EnvVariable ¶
type EnvVariable struct {
// contains filtered or unexported fields
}
EnvVariable is a simple key value object that represents an environment variable.
type File ¶
type File struct {
// contains filtered or unexported fields
}
A file
type FileID ¶
type FileID string
func (FileID) GraphQLMarshal ¶
GraphQLMarshal serializes the structure into GraphQL
func (FileID) GraphQLType ¶
GraphQLType returns the native GraphQL type name
type GitRef ¶
type GitRef struct {
// contains filtered or unexported fields
}
A git ref (tag or branch)
type GitRepository ¶
type GitRepository struct {
// contains filtered or unexported fields
}
A git repository
func (*GitRepository) Branch ¶
func (r *GitRepository) Branch(name string) *GitRef
Details on one branch
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
Information about the host execution environment
func (*Host) Directory ¶
func (r *Host) Directory(id HostDirectoryID) *HostDirectory
Access a directory on the host
func (*Host) EnvVariable ¶
func (r *Host) EnvVariable(name string) *HostVariable
Lookup the value of an environment variable. Null if the variable is not available.
func (*Host) Workdir ¶
func (r *Host) Workdir() *HostDirectory
The current working directory on the host
type HostDirectory ¶
type HostDirectory struct {
// contains filtered or unexported fields
}
A directory on the host
func (*HostDirectory) Read ¶
func (r *HostDirectory) Read() *Directory
Read the contents of the directory
func (*HostDirectory) Write ¶
func (r *HostDirectory) Write(ctx context.Context, contents DirectoryID, opts ...HostDirectoryWriteOpts) (bool, error)
Write the contents of another directory to the directory
type HostDirectoryID ¶
type HostDirectoryID string
An identifier for a directory on the host
func (HostDirectoryID) GraphQLMarshal ¶
func (s HostDirectoryID) GraphQLMarshal(ctx context.Context) (any, error)
GraphQLMarshal serializes the structure into GraphQL
func (HostDirectoryID) GraphQLType ¶
func (s HostDirectoryID) GraphQLType() string
GraphQLType returns the native GraphQL type name
type HostDirectoryWriteOpts ¶
type HostDirectoryWriteOpts struct {
Path string
}
HostDirectoryWriteOpts contains options for HostDirectory.Write
type HostVariable ¶
type HostVariable struct {
// contains filtered or unexported fields
}
An environment variable on the host environment
func (*HostVariable) Secret ¶
func (r *HostVariable) Secret() *Secret
A secret referencing the value of this variable
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
A set of scripts and/or extensions
func (*Project) Extensions ¶
extensions in this project
func (*Project) GeneratedCode ¶
Code files generated by the SDKs in the project
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
func (*Query) CacheVolume ¶
func (r *Query) CacheVolume(key string) *CacheVolume
Construct a cache volume for a given cache key
func (*Query) Container ¶
func (r *Query) Container(opts ...ContainerOpts) *Container
Load a container from ID. Null ID returns an empty container (scratch).
func (*Query) Directory ¶
func (r *Query) Directory(opts ...DirectoryOpts) *Directory
Load a directory by ID. No argument produces an empty directory.
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
type SecretID ¶
type SecretID string
A unique identifier for a secret
func (SecretID) GraphQLMarshal ¶
GraphQLMarshal serializes the structure into GraphQL
func (SecretID) GraphQLType ¶
GraphQLType returns the native GraphQL type name