Documentation ¶
Index ¶
- Constants
- Variables
- func AddEnv(env []string, name, value string) []string
- func LoadBlob(ctx context.Context, srv *dagql.Server, desc specs.Descriptor) (i dagql.Instance[*Directory], err error)
- func LookupEnv(env []string, name string) (string, bool)
- func WalkEnv(env []string, fn func(string, string, string))
- type AliasSet
- type BuildArg
- type CacheSharingMode
- func (mode CacheSharingMode) Decoder() dagql.InputDecoder
- func (mode CacheSharingMode) MarshalJSON() ([]byte, error)
- func (mode CacheSharingMode) ToLiteral() *idproto.Literal
- func (mode CacheSharingMode) Type() *ast.Type
- func (mode CacheSharingMode) TypeDescription() string
- func (mode *CacheSharingMode) UnmarshalJSON(payload []byte) error
- type CacheVolume
- type CacheVolumeID
- type CallInput
- type CallOpts
- type Callable
- type CallableField
- type ClientCallContext
- type Container
- func (container *Container) AsTarball(ctx context.Context, platformVariants []*Container, ...) (*File, error)
- func (container *Container) Build(ctx context.Context, contextDir *Directory, dockerfile string, ...) (*Container, error)
- func (container *Container) Clone() *Container
- func (container *Container) Directory(ctx context.Context, dirPath string) (*Directory, error)
- func (container Container) Evaluate(ctx context.Context) (*buildkit.Result, error)
- func (container *Container) Export(ctx context.Context, dest string, platformVariants []*Container, ...) error
- func (container *Container) FSState() (llb.State, error)
- func (container *Container) File(ctx context.Context, filePath string) (*File, error)
- func (container *Container) From(ctx context.Context, addr string) (*Container, error)
- func (container *Container) ImageConfig(ctx context.Context) (specs.ImageConfig, error)
- func (container *Container) ImageRefOrErr(ctx context.Context) (string, error)
- func (container *Container) Import(ctx context.Context, source *File, tag string) (*Container, error)
- func (container *Container) MetaFileContents(ctx context.Context, filePath string) (string, error)
- func (container *Container) MetaState() (*llb.State, error)
- func (container *Container) MountTargets(ctx context.Context) ([]string, error)
- func (container *Container) PBDefinitions(ctx context.Context) ([]*pb.Definition, error)
- func (container *Container) PipelinePath() pipeline.Path
- func (container *Container) Publish(ctx context.Context, ref string, platformVariants []*Container, ...) (string, error)
- func (container *Container) RootFS(ctx context.Context) (*Directory, error)
- func (container *Container) Service(ctx context.Context) (*Service, error)
- func (container *Container) Terminal(svcID *idproto.ID, args []string) (*Terminal, http.Handler, error)
- func (*Container) Type() *ast.Type
- func (*Container) TypeDescription() string
- func (container *Container) UpdateImageConfig(ctx context.Context, updateFn func(specs.ImageConfig) specs.ImageConfig) (*Container, error)
- func (container *Container) WithDirectory(ctx context.Context, subdir string, src *Directory, filter CopyFilter, ...) (*Container, error)
- func (container *Container) WithExec(ctx context.Context, opts ContainerExecOpts) (*Container, error)
- func (container *Container) WithExposedPort(port Port) (*Container, error)
- func (container *Container) WithFile(ctx context.Context, destPath string, src *File, permissions *int, ...) (*Container, error)
- func (container *Container) WithFiles(ctx context.Context, destDir string, src []*File, permissions *int, ...) (*Container, error)
- func (container *Container) WithGPU(ctx context.Context, gpuOpts ContainerGPUOpts) (*Container, error)
- func (container *Container) WithMountedCache(ctx context.Context, target string, cache *CacheVolume, source *Directory, ...) (*Container, error)
- func (container *Container) WithMountedDirectory(ctx context.Context, target string, dir *Directory, owner string, ...) (*Container, error)
- func (container *Container) WithMountedFile(ctx context.Context, target string, file *File, owner string, readonly bool) (*Container, error)
- func (container *Container) WithMountedSecret(ctx context.Context, target string, source *Secret, owner string, ...) (*Container, error)
- func (container *Container) WithMountedTemp(ctx context.Context, target string) (*Container, error)
- func (container *Container) WithNewFile(ctx context.Context, dest string, content []byte, permissions fs.FileMode, ...) (*Container, error)
- func (container *Container) WithPipeline(ctx context.Context, name, description string, labels []pipeline.Label) (*Container, error)
- func (container *Container) WithRootFS(ctx context.Context, dir *Directory) (*Container, error)
- func (container *Container) WithSecretVariable(ctx context.Context, name string, secret *Secret) (*Container, error)
- func (container *Container) WithServiceBinding(ctx context.Context, id *idproto.ID, svc *Service, alias string) (*Container, error)
- func (container *Container) WithUnixSocket(ctx context.Context, target string, source *Socket, owner string) (*Container, error)
- func (container *Container) WithoutExposedPort(port int, protocol NetworkProtocol) (*Container, error)
- func (container *Container) WithoutMount(ctx context.Context, target string) (*Container, error)
- func (container *Container) WithoutUnixSocket(ctx context.Context, target string) (*Container, error)
- type ContainerExecOpts
- type ContainerGPUOpts
- type ContainerID
- type ContainerMount
- type ContainerMounts
- type ContainerSecret
- type ContainerSocket
- type CopyFilter
- type CurrentModule
- type Directory
- func (dir *Directory) AsBlob(ctx context.Context, srv *dagql.Server) (inst dagql.Instance[*Directory], rerr error)
- func (dir *Directory) Clone() *Directory
- func (dir *Directory) Diff(ctx context.Context, other *Directory) (*Directory, error)
- func (dir *Directory) Directory(ctx context.Context, subdir string) (*Directory, error)
- func (dir *Directory) Entries(ctx context.Context, src string) ([]string, error)
- func (dir *Directory) Evaluate(ctx context.Context) (*buildkit.Result, error)
- func (dir *Directory) Export(ctx context.Context, destPath string) (rerr error)
- func (dir *Directory) File(ctx context.Context, file string) (*File, error)
- func (dir *Directory) Glob(ctx context.Context, src string, pattern string) ([]string, error)
- func (dir *Directory) PBDefinitions(ctx context.Context) ([]*pb.Definition, error)
- func (dir *Directory) PipelinePath() pipeline.Path
- func (dir *Directory) Root() (*Directory, error)
- func (dir *Directory) SetState(ctx context.Context, st llb.State) error
- func (dir *Directory) Stat(ctx context.Context, bk *buildkit.Client, svcs *Services, src string) (*fstypes.Stat, error)
- func (dir *Directory) State() (llb.State, error)
- func (dir *Directory) StateWithSourcePath() (llb.State, error)
- func (*Directory) Type() *ast.Type
- func (*Directory) TypeDescription() string
- func (dir *Directory) WithDirectory(ctx context.Context, destDir string, src *Directory, filter CopyFilter, ...) (*Directory, error)
- func (dir *Directory) WithFile(ctx context.Context, destPath string, src *File, permissions *int, ...) (*Directory, error)
- func (dir *Directory) WithFiles(ctx context.Context, destDir string, src []*File, permissions *int, ...) (*Directory, error)
- func (dir *Directory) WithNewDirectory(ctx context.Context, dest string, permissions fs.FileMode) (*Directory, error)
- func (dir *Directory) WithNewFile(ctx context.Context, dest string, content []byte, permissions fs.FileMode, ...) (*Directory, error)
- func (dir *Directory) WithPipeline(ctx context.Context, name, description string, labels []pipeline.Label) (*Directory, error)
- func (dir *Directory) WithTimestamps(ctx context.Context, unix int) (*Directory, error)
- func (dir *Directory) Without(ctx context.Context, path string) (*Directory, error)
- type DirectoryID
- type DynamicID
- func (d DynamicID) DecodeInput(val any) (dagql.Input, error)
- func (d DynamicID) Decoder() dagql.InputDecoder
- func (d DynamicID) ID() *idproto.ID
- func (d DynamicID) MarshalJSON() ([]byte, error)
- func (d DynamicID) ToLiteral() *idproto.Literal
- func (d DynamicID) Type() *ast.Type
- func (d DynamicID) TypeName() string
- type FieldTypeDef
- type File
- func NewFile(query *Query, def *pb.Definition, file string, platform Platform, ...) *File
- func NewFileSt(ctx context.Context, query *Query, st llb.State, dir string, platform Platform, ...) (*File, error)
- func NewFileWithContents(ctx context.Context, query *Query, name string, content []byte, ...) (*File, error)
- func (file *File) Clone() *File
- func (file *File) Contents(ctx context.Context) ([]byte, error)
- func (file *File) Evaluate(ctx context.Context) (*buildkit.Result, error)
- func (file *File) Export(ctx context.Context, dest string, allowParentDirPath bool) error
- func (file *File) Open(ctx context.Context) (io.ReadCloser, error)
- func (file *File) PBDefinitions(ctx context.Context) ([]*pb.Definition, error)
- func (file *File) PipelinePath() pipeline.Path
- func (file *File) Stat(ctx context.Context) (*fstypes.Stat, error)
- func (file *File) State() (llb.State, error)
- func (*File) Type() *ast.Type
- func (*File) TypeDescription() string
- func (file *File) WithTimestamps(ctx context.Context, unix int) (*File, error)
- type FileID
- type Function
- func (fn Function) Clone() *Function
- func (fn *Function) FieldSpec() (dagql.FieldSpec, error)
- func (fn *Function) IsSubtypeOf(otherFn *Function) bool
- func (fn *Function) LookupArg(name string) (*FunctionArg, bool)
- func (*Function) Type() *ast.Type
- func (*Function) TypeDescription() string
- func (fn *Function) WithArg(name string, typeDef *TypeDef, desc string, defaultValue JSON) *Function
- func (fn *Function) WithDescription(desc string) *Function
- type FunctionArg
- type FunctionArgID
- type FunctionCall
- type FunctionCallArgValue
- type FunctionID
- type GeneratedCode
- func (code GeneratedCode) Clone() *GeneratedCode
- func (code *GeneratedCode) PBDefinitions(ctx context.Context) ([]*pb.Definition, error)
- func (*GeneratedCode) Type() *ast.Type
- func (*GeneratedCode) TypeDescription() string
- func (code *GeneratedCode) WithVCSGeneratedPaths(paths []string) *GeneratedCode
- func (code *GeneratedCode) WithVCSIgnoredPaths(paths []string) *GeneratedCode
- type GeneratedCodeID
- type GitModuleSource
- func (src GitModuleSource) Clone() *GitModuleSource
- func (src *GitModuleSource) CloneURL() string
- func (src *GitModuleSource) HTMLURL() string
- func (src *GitModuleSource) PBDefinitions(ctx context.Context) ([]*pb.Definition, error)
- func (src *GitModuleSource) RefString() string
- func (src *GitModuleSource) Symbolic() string
- func (src *GitModuleSource) Type() *ast.Type
- func (src *GitModuleSource) TypeDescription() string
- type GitModuleSourceID
- type GitRef
- type GitRefID
- type GitRepository
- type GitRepositoryID
- type HasPBDefinitions
- type Host
- func (host *Host) Directory(ctx context.Context, srv *dagql.Server, dirPath string, ...) (dagql.Instance[*Directory], error)
- func (host *Host) File(ctx context.Context, srv *dagql.Server, filePath string) (dagql.Instance[*File], error)
- func (host *Host) SetSecretFile(ctx context.Context, srv *dagql.Server, secretName string, path string) (i dagql.Instance[*Secret], err error)
- func (host *Host) Socket(sockPath string) *Socket
- func (*Host) Type() *ast.Type
- func (*Host) TypeDescription() string
- type ImageLayerCompression
- type ImageMediaTypes
- type InputTypeDef
- type InterfaceAnnotatedValue
- type InterfaceType
- func (iface *InterfaceType) ConvertFromSDKResult(ctx context.Context, value any) (dagql.Typed, error)
- func (iface *InterfaceType) ConvertToSDKInput(ctx context.Context, value dagql.Typed) (any, error)
- func (iface *InterfaceType) Install(ctx context.Context, dag *dagql.Server) error
- func (iface *InterfaceType) SourceMod() Mod
- func (iface *InterfaceType) TypeDef() *TypeDef
- type InterfaceTypeDef
- type JSON
- func (p JSON) Bytes() []byte
- func (JSON) DecodeInput(val any) (res dagql.Input, err error)
- func (p JSON) Decoder() dagql.InputDecoder
- func (p JSON) MarshalJSON() ([]byte, error)
- func (p JSON) ToLiteral() *idproto.Literal
- func (p JSON) Type() *ast.Type
- func (p JSON) TypeDescription() string
- func (p JSON) TypeName() string
- type ListType
- type ListTypeDef
- type LocalModuleSource
- func (src LocalModuleSource) Clone() *LocalModuleSource
- func (src *LocalModuleSource) PBDefinitions(ctx context.Context) ([]*pb.Definition, error)
- func (src *LocalModuleSource) RefString() string
- func (src *LocalModuleSource) Symbolic() string
- func (src *LocalModuleSource) Type() *ast.Type
- func (src *LocalModuleSource) TypeDescription() string
- type LocalModuleSourceID
- type Mod
- type ModDeps
- func (d *ModDeps) Append(mods ...Mod) *ModDeps
- func (d *ModDeps) ModTypeFor(ctx context.Context, typeDef *TypeDef) (ModType, bool, error)
- func (d *ModDeps) Prepend(mods ...Mod) *ModDeps
- func (d *ModDeps) Schema(ctx context.Context) (*dagql.Server, error)
- func (d *ModDeps) SchemaIntrospectionJSON(ctx context.Context, forModule bool) (string, error)
- func (d *ModDeps) TypeDefs(ctx context.Context) ([]*TypeDef, error)
- type ModType
- type Module
- func (mod Module) Clone() *Module
- func (mod *Module) Dependencies() []Mod
- func (mod *Module) DependencySchemaIntrospectionJSON(ctx context.Context, forModule bool) (string, error)
- func (mod *Module) IDModule() *idproto.Module
- func (mod *Module) Initialize(ctx context.Context, oldSelf dagql.Instance[*Module], newID *idproto.ID) (*Module, error)
- func (mod *Module) Install(ctx context.Context, dag *dagql.Server) error
- func (mod *Module) ModTypeFor(ctx context.Context, typeDef *TypeDef, checkDirectDeps bool) (ModType, bool, error)
- func (mod *Module) Name() string
- func (mod *Module) PBDefinitions(ctx context.Context) ([]*pb.Definition, error)
- func (*Module) Type() *ast.Type
- func (mod *Module) TypeDefs(ctx context.Context) ([]*TypeDef, error)
- func (*Module) TypeDescription() string
- func (mod *Module) WithDescription(desc string) *Module
- func (mod *Module) WithInterface(ctx context.Context, def *TypeDef) (*Module, error)
- func (mod *Module) WithObject(ctx context.Context, def *TypeDef) (*Module, error)
- type ModuleDependency
- type ModuleDependencyID
- type ModuleFunction
- type ModuleID
- type ModuleObject
- type ModuleObjectType
- func (t *ModuleObjectType) ConvertFromSDKResult(ctx context.Context, value any) (dagql.Typed, error)
- func (t *ModuleObjectType) ConvertToSDKInput(ctx context.Context, value dagql.Typed) (any, error)
- func (t *ModuleObjectType) GetCallable(ctx context.Context, name string) (Callable, error)
- func (t *ModuleObjectType) SourceMod() Mod
- func (t *ModuleObjectType) TypeDef() *TypeDef
- type ModuleSource
- func (src ModuleSource) Clone() *ModuleSource
- func (src *ModuleSource) ContextDirectory() (inst dagql.Instance[*Directory], err error)
- func (src *ModuleSource) ModuleConfig(ctx context.Context) (*modules.ModuleConfig, bool, error)
- func (src *ModuleSource) ModuleName(ctx context.Context) (string, error)
- func (src *ModuleSource) ModuleOriginalName(ctx context.Context) (string, error)
- func (src *ModuleSource) PBDefinitions(ctx context.Context) ([]*pb.Definition, error)
- func (src *ModuleSource) RefString() (string, error)
- func (src *ModuleSource) SDK(ctx context.Context) (string, error)
- func (src *ModuleSource) SourceRootSubpath() (string, error)
- func (src *ModuleSource) SourceSubpath(ctx context.Context) (string, error)
- func (src *ModuleSource) SourceSubpathWithDefault(ctx context.Context) (string, error)
- func (src *ModuleSource) Symbolic() (string, error)
- func (src *ModuleSource) Type() *ast.Type
- func (src *ModuleSource) TypeDescription() string
- type ModuleSourceID
- type ModuleSourceKind
- type NetworkProtocol
- type NullableType
- type ObjectTypeDef
- func (obj ObjectTypeDef) Clone() *ObjectTypeDef
- func (obj *ObjectTypeDef) FieldByName(name string) (*FieldTypeDef, bool)
- func (obj *ObjectTypeDef) FieldByOriginalName(name string) (*FieldTypeDef, bool)
- func (obj *ObjectTypeDef) FunctionByName(name string) (*Function, bool)
- func (obj *ObjectTypeDef) IsSubtypeOf(iface *InterfaceTypeDef) bool
- func (*ObjectTypeDef) Type() *ast.Type
- func (*ObjectTypeDef) TypeDescription() string
- type Ownership
- type Platform
- func (Platform) DecodeInput(val any) (dagql.Input, error)
- func (p Platform) Decoder() dagql.InputDecoder
- func (p Platform) Format() string
- func (p Platform) MarshalJSON() ([]byte, error)
- func (p Platform) Spec() specs.Platform
- func (p Platform) ToLiteral() *idproto.Literal
- func (p Platform) Type() *ast.Type
- func (p Platform) TypeDescription() string
- func (p Platform) TypeName() string
- type Port
- type PortForward
- type PrimitiveType
- type Query
- func (q *Query) ClientCallContext(clientDigest digest.Digest) (*ClientCallContext, bool)
- func (q Query) Clone() *Query
- func (q *Query) CurrentFunctionCall(ctx context.Context) (*FunctionCall, error)
- func (q *Query) CurrentModule(ctx context.Context) (*Module, error)
- func (q *Query) CurrentServedDeps(ctx context.Context) (*ModDeps, error)
- func (q *Query) IDDeps(ctx context.Context, id *idproto.ID) (*ModDeps, error)
- func (q *Query) InstallDefaultClientContext(deps *ModDeps)
- func (q *Query) MuxEndpoint(ctx context.Context, path string, handler http.Handler) error
- func (q *Query) MuxEndpoints(mux *http.ServeMux)
- func (q *Query) NewContainer(platform Platform) *Container
- func (q *Query) NewContainerService(ctr *Container) *Service
- func (q *Query) NewHost() *Host
- func (q *Query) NewHostService(upstream string, ports []PortForward) *Service
- func (q *Query) NewModule() *Module
- func (q *Query) NewSecret(name string) *Secret
- func (q *Query) NewTunnelService(upstream dagql.Instance[*Service], ports []PortForward) *Service
- func (q *Query) RegisterFunctionCall(dgst digest.Digest, deps *ModDeps, mod *Module, call *FunctionCall, ...) error
- func (q *Query) ServeModuleToMainClient(ctx context.Context, modMeta dagql.Instance[*Module]) error
- func (*Query) Type() *ast.Type
- func (*Query) TypeDescription() string
- func (q *Query) WithPipeline(name, desc string, labels []pipeline.Label) *Query
- type RunningService
- type SDK
- type Secret
- type SecretID
- type SecretStore
- type SecretToScrubInfo
- type Service
- func (svc *Service) Clone() *Service
- func (svc *Service) Endpoint(ctx context.Context, id *idproto.ID, port int, scheme string) (string, error)
- func (svc *Service) Hostname(ctx context.Context, id *idproto.ID) (string, error)
- func (svc *Service) PipelinePath() pipeline.Path
- func (svc *Service) Ports(ctx context.Context, id *idproto.ID) ([]Port, error)
- func (svc *Service) Start(ctx context.Context, id *idproto.ID, interactive bool, ...) (running *RunningService, err error)
- func (svc *Service) StartAndTrack(ctx context.Context, id *idproto.ID) error
- func (svc *Service) Stop(ctx context.Context, id *idproto.ID, kill bool) error
- func (*Service) Type() *ast.Type
- func (*Service) TypeDescription() string
- type ServiceBinding
- type ServiceBindings
- type ServiceID
- type ServiceKey
- type Services
- func (ss *Services) Detach(ctx context.Context, svc *RunningService)
- func (ss *Services) Get(ctx context.Context, id *idproto.ID) (*RunningService, error)
- func (ss *Services) Start(ctx context.Context, id *idproto.ID, svc Startable) (*RunningService, error)
- func (ss *Services) StartBindings(ctx context.Context, bindings ServiceBindings) (_ func(), _ []*RunningService, err error)
- func (ss *Services) Stop(ctx context.Context, id *idproto.ID, kill bool) error
- func (ss *Services) StopClientServices(ctx context.Context, client *engine.ClientMetadata) error
- type Socket
- type SocketID
- type Startable
- type Terminal
- type TypeDef
- func (typeDef TypeDef) Clone() *TypeDef
- func (typeDef *TypeDef) IsSubtypeOf(otherDef *TypeDef) bool
- func (typeDef *TypeDef) ToInput() dagql.Input
- func (typeDef *TypeDef) ToType() *ast.Type
- func (typeDef *TypeDef) ToTyped() dagql.Typed
- func (*TypeDef) Type() *ast.Type
- func (*TypeDef) TypeDescription() string
- func (typeDef *TypeDef) Underlying() *TypeDef
- func (typeDef *TypeDef) WithFunction(fn *Function) (*TypeDef, error)
- func (typeDef *TypeDef) WithInterface(name, desc string) *TypeDef
- func (typeDef *TypeDef) WithKind(kind TypeDefKind) *TypeDef
- func (typeDef *TypeDef) WithListOf(elem *TypeDef) *TypeDef
- func (typeDef *TypeDef) WithObject(name, desc string) *TypeDef
- func (typeDef *TypeDef) WithObjectConstructor(fn *Function) (*TypeDef, error)
- func (typeDef *TypeDef) WithObjectField(name string, fieldType *TypeDef, desc string) (*TypeDef, error)
- func (typeDef *TypeDef) WithOptional(optional bool) *TypeDef
- type TypeDefID
- type TypeDefKind
- type UserModFunctionArg
- type Void
Constants ¶
const ( // DetachGracePeriod is an arbitrary amount of time between when a service is // no longer actively used and before it is detached. This is to avoid repeated // stopping and re-starting of the same service in rapid succession. DetachGracePeriod = 10 * time.Second // TerminateGracePeriod is an arbitrary amount of time between when a service is // sent a graceful stop (SIGTERM) and when it is sent an immediate stop (SIGKILL). TerminateGracePeriod = 10 * time.Second )
const (
ModuleName = "daggercore"
)
const (
ShimEnableTTYEnvVar = "_DAGGER_ENABLE_TTY"
)
Variables ¶
var ( CacheSharingModePrivate = CacheSharingModes.Register("PRIVATE", "Keeps a cache volume for a single build pipeline") CacheSharingModeLocked = CacheSharingModes.Register("LOCKED", "Shares the cache volume amongst many build pipelines, but will serialize the writes") )"Shares the cache volume amongst many build pipelines")
var ( CompressionGzip = ImageLayerCompressions.Register("Gzip") CompressionZstd = ImageLayerCompressions.Register("Zstd") CompressionEStarGZ = ImageLayerCompressions.Register("EStarGZ") CompressionUncompressed = ImageLayerCompressions.Register("Uncompressed") )
var ( OCIMediaTypes = ImageMediaTypesEnum.Register("OCIMediaTypes") DockerMediaTypes = ImageMediaTypesEnum.Register("DockerMediaTypes") )
var ( ModuleSourceKindLocal = ModuleSourceKindEnum.Register("LOCAL_SOURCE") ModuleSourceKindGit = ModuleSourceKindEnum.Register("GIT_SOURCE") )
var ( NetworkProtocolTCP = NetworkProtocols.Register("TCP") NetworkProtocolUDP = NetworkProtocols.Register("UDP") )
var ( TypeDefKindString = TypeDefKinds.Register("STRING_KIND", "A string value.") TypeDefKindInteger = TypeDefKinds.Register("INTEGER_KIND", "An integer value.") TypeDefKindBoolean = TypeDefKinds.Register("BOOLEAN_KIND", "A boolean value.") TypeDefKindList = TypeDefKinds.Register("LIST_KIND", "A list of values all having the same type.", "Always paired with a ListTypeDef.") TypeDefKindObject = TypeDefKinds.Register("OBJECT_KIND", "A named type defined in the GraphQL schema, with fields and functions.", "Always paired with an ObjectTypeDef.") TypeDefKindInterface = TypeDefKinds.Register("INTERFACE_KIND", `A named type of functions that can be matched+implemented by other objects+interfaces.`, "Always paired with an InterfaceTypeDef.") TypeDefKindInput = TypeDefKinds.Register("INPUT_KIND", `A graphql input type, used only when representing the core API via TypeDefs.`, ) TypeDefKindVoid = TypeDefKinds.Register("VOID_KIND", "A special kind used to signify that no value is returned.", `This is used for functions that have no return value. The outer TypeDef specifying this Kind is always Optional, as the Void is never actually represented.`, ) )
var CacheSharingModes = dagql.NewEnum[CacheSharingMode]()
var ErrContainerNoExec = errors.New("no command has been executed")
var ErrInvalidCacheVolumeID = errors.New("invalid cache ID; create one using cacheVolume")
var ImageLayerCompressions = dagql.NewEnum[ImageLayerCompression]()
var ImageMediaTypesEnum = dagql.NewEnum[ImageMediaTypes]()
var ModuleSourceKindEnum = dagql.NewEnum[ModuleSourceKind]()
var NetworkProtocols = dagql.NewEnum[NetworkProtocol]()
var SeenCacheKeys = new(sync.Map)
var TypeDefKinds = dagql.NewEnum[TypeDefKind]()
Functions ¶
Types ¶
type BuildArg ¶ added in v0.3.8
type BuildArg struct { Name string `field:"true" doc:"The build argument name."` Value string `field:"true" doc:"The build argument value."` }
func (BuildArg) TypeDescription ¶ added in v0.9.7
type CacheSharingMode ¶ added in v0.3.12
type CacheSharingMode string
func (CacheSharingMode) Decoder ¶ added in v0.9.7
func (mode CacheSharingMode) Decoder() dagql.InputDecoder
func (CacheSharingMode) MarshalJSON ¶ added in v0.9.0
func (mode CacheSharingMode) MarshalJSON() ([]byte, error)
CacheSharingMode marshals to its lowercased value.
NB: as far as I can recall this is purely for ~*aesthetic*~. GraphQL consts are so shouty!
func (CacheSharingMode) ToLiteral ¶ added in v0.9.7
func (mode CacheSharingMode) ToLiteral() *idproto.Literal
func (CacheSharingMode) Type ¶ added in v0.9.7
func (mode CacheSharingMode) Type() *ast.Type
func (CacheSharingMode) TypeDescription ¶ added in v0.9.7
func (mode CacheSharingMode) TypeDescription() string
func (*CacheSharingMode) UnmarshalJSON ¶ added in v0.9.0
func (mode *CacheSharingMode) UnmarshalJSON(payload []byte) error
CacheSharingMode marshals to its lowercased value.
NB: as far as I can recall this is purely for ~*aesthetic*~. GraphQL consts are so shouty!
type CacheVolume ¶
type CacheVolume struct {
Keys []string `json:"keys"`
}
CacheVolume is a persistent volume with a globally scoped identifier.
func NewCache ¶
func NewCache(keys ...string) *CacheVolume
func (*CacheVolume) Clone ¶ added in v0.5.1
func (cache *CacheVolume) Clone() *CacheVolume
func (*CacheVolume) Sum ¶ added in v0.5.1
func (cache *CacheVolume) Sum() string
Sum returns a checksum of the cache tokens suitable for use as a cache key.
func (*CacheVolume) Type ¶ added in v0.9.7
func (*CacheVolume) Type() *ast.Type
func (*CacheVolume) TypeDescription ¶ added in v0.9.7
func (*CacheVolume) TypeDescription() string
type CacheVolumeID ¶ added in v0.9.0
type CacheVolumeID = dagql.ID[*CacheVolume]
type CallableField ¶ added in v0.9.7
type CallableField struct { Module *Module Field *FieldTypeDef Return ModType }
func (*CallableField) ArgType ¶ added in v0.9.7
func (f *CallableField) ArgType(argName string) (ModType, error)
func (*CallableField) ReturnType ¶ added in v0.9.7
func (f *CallableField) ReturnType() (ModType, error)
type ClientCallContext ¶ added in v0.9.7
type ClientCallContext struct { // the DAG of modules being served to this client Deps *ModDeps // If the client is itself from a function call in a user module, these are set with the // metadata of that ongoing function call Module *Module FnCall *FunctionCall ProgrockParent string }
type Container ¶
type Container struct { Query *Query // The container's root filesystem. FS *pb.Definition `json:"fs"` // Image configuration (env, workdir, etc) Config specs.ImageConfig `json:"cfg"` // List of GPU devices that will be exposed to the container EnabledGPUs []string `json:"enabledGPUs,omitempty"` // Mount points configured for the container. Mounts ContainerMounts `json:"mounts,omitempty"` // Meta is the /dagger filesystem. It will be null if nothing has run yet. Meta *pb.Definition `json:"meta,omitempty"` // The platform of the container's rootfs. Platform Platform `json:"platform,omitempty"` // Secrets to expose to the container. Secrets []ContainerSecret `json:"secret_env,omitempty"` // Sockets to expose to the container. Sockets []ContainerSocket `json:"sockets,omitempty"` // Image reference ImageRef string `json:"image_ref,omitempty"` // Ports to expose from the container. Ports []Port `json:"ports,omitempty"` // Services to start before running the container. Services ServiceBindings `json:"services,omitempty"` // Focused indicates whether subsequent operations will be // focused, i.e. shown more prominently in the UI. Focused bool `json:"focused"` // The args to invoke when using the terminal api on this container. DefaultTerminalCmd []string `json:"defaultTerminalCmd,omitempty"` }
Container is a content-addressed container.
func NewContainer ¶ added in v0.3.3
func (*Container) AsTarball ¶ added in v0.9.0
func (container *Container) AsTarball( ctx context.Context, platformVariants []*Container, forcedCompression ImageLayerCompression, mediaTypes ImageMediaTypes, ) (*File, error)
func (*Container) Clone ¶ added in v0.5.1
Clone returns a deep copy of the container suitable for modifying in a WithXXX method.
func (*Container) Export ¶ added in v0.3.3
func (container *Container) Export( ctx context.Context, dest string, platformVariants []*Container, forcedCompression ImageLayerCompression, mediaTypes ImageMediaTypes, ) error
func (*Container) FSState ¶ added in v0.5.1
FSState returns the container's root filesystem mount state. If there is none (as with an empty container ID), it returns scratch.
func (*Container) ImageConfig ¶
func (*Container) ImageRefOrErr ¶ added in v0.5.1
func (*Container) MetaFileContents ¶ added in v0.3.5
func (*Container) MetaState ¶ added in v0.5.1
MetaState returns the container's metadata mount state. If the container has yet to run, it returns nil.
func (*Container) MountTargets ¶ added in v0.5.1
func (*Container) PBDefinitions ¶ added in v0.8.8
func (*Container) PipelinePath ¶ added in v0.5.2
PipelinePath returns the container's pipeline path.
func (*Container) Publish ¶
func (container *Container) Publish( ctx context.Context, ref string, platformVariants []*Container, forcedCompression ImageLayerCompression, mediaTypes ImageMediaTypes, ) (string, error)
func (*Container) TypeDescription ¶ added in v0.9.7
func (*Container) UpdateImageConfig ¶
func (container *Container) UpdateImageConfig(ctx context.Context, updateFn func(specs.ImageConfig) specs.ImageConfig) (*Container, error)
func (*Container) WithDirectory ¶ added in v0.3.7
func (*Container) WithExposedPort ¶ added in v0.3.13
func (*Container) WithMountedCache ¶
func (container *Container) WithMountedCache(ctx context.Context, target string, cache *CacheVolume, source *Directory, sharingMode CacheSharingMode, owner string) (*Container, error)
func (*Container) WithMountedDirectory ¶
func (*Container) WithMountedFile ¶
func (*Container) WithMountedSecret ¶
func (*Container) WithMountedTemp ¶
func (*Container) WithNewFile ¶ added in v0.3.7
func (*Container) WithPipeline ¶ added in v0.5.1
func (*Container) WithRootFS ¶ added in v0.3.5
func (*Container) WithSecretVariable ¶
func (*Container) WithServiceBinding ¶ added in v0.5.0
func (*Container) WithUnixSocket ¶ added in v0.3.7
func (*Container) WithoutExposedPort ¶ added in v0.3.13
func (container *Container) WithoutExposedPort(port int, protocol NetworkProtocol) (*Container, error)
func (*Container) WithoutMount ¶
type ContainerExecOpts ¶
type ContainerExecOpts struct { // Command to run instead of the container's default command Args []string // If the container has an entrypoint, ignore it for this exec rather than // calling it with args. SkipEntrypoint bool `default:"false"` // Content to write to the command's standard input before closing Stdin string `default:""` // Redirect the command's standard output to a file in the container RedirectStdout string `default:""` // Redirect the command's standard error to a file in the container RedirectStderr string `default:""` // Provide 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 `default:"false"` // Grant the process all root capabilities InsecureRootCapabilities bool `default:"false"` // (Internal-only) If this exec is for a module function, this digest will be set in the // grpc context metadata for any api requests back to the engine. It's used by the API // server to determine which schema to serve and other module context metadata. ModuleCallerDigest digest.Digest `name:"-"` // (Internal-only) Used for module function execs to trigger the nested api client to // be connected back to the same session. NestedInSameSession bool `name:"-"` }
type ContainerGPUOpts ¶ added in v0.9.2
type ContainerGPUOpts struct {
Devices []string
}
type ContainerID ¶
type ContainerMount ¶
type ContainerMount struct { // The source of the mount. Source *pb.Definition `json:"source,omitempty"` // A path beneath the source to scope the mount to. SourcePath string `json:"source_path,omitempty"` // The path of the mount within the container. Target string `json:"target"` // Persist changes to the mount under this cache ID. CacheVolumeID string `json:"cache_volume_id,omitempty"` // How to share the cache across concurrent runs. CacheSharingMode CacheSharingMode `json:"cache_sharing,omitempty"` // Configure the mount as a tmpfs. Tmpfs bool `json:"tmpfs,omitempty"` // Configure the mount as read-only. Readonly bool `json:"readonly,omitempty"` }
ContainerMount is a mount point configured in a container.
func (ContainerMount) SourceState ¶
func (mnt ContainerMount) SourceState() (llb.State, error)
SourceState returns the state of the source of the mount.
type ContainerMounts ¶ added in v0.3.3
type ContainerMounts []ContainerMount
func (ContainerMounts) With ¶ added in v0.3.3
func (mnts ContainerMounts) With(newMnt ContainerMount) ContainerMounts
type ContainerSecret ¶
type ContainerSecret struct { Secret *Secret `json:"secret"` EnvName string `json:"env,omitempty"` MountPath string `json:"path,omitempty"` Owner *Ownership `json:"owner,omitempty"` Mode fs.FileMode `json:"mode,omitempty"` }
ContainerSecret configures a secret to expose, either as an environment variable or mounted to a file path.
type ContainerSocket ¶ added in v0.3.7
type ContainerSocket struct { Source *Socket `json:"socket"` ContainerPath string `json:"container_path,omitempty"` Owner *Ownership `json:"owner,omitempty"` }
ContainerSocket configures a socket to expose, currently as a Unix socket, but potentially as a TCP or UDP address in the future.
type CopyFilter ¶ added in v0.3.3
type CurrentModule ¶ added in v0.9.8
type CurrentModule struct {
Module *Module
}
func (CurrentModule) Clone ¶ added in v0.9.8
func (mod CurrentModule) Clone() *CurrentModule
func (*CurrentModule) Type ¶ added in v0.9.8
func (*CurrentModule) Type() *ast.Type
func (*CurrentModule) TypeDescription ¶ added in v0.9.8
func (*CurrentModule) TypeDescription() string
type Directory ¶
type Directory struct { Query *Query LLB *pb.Definition Dir string Platform Platform // Services necessary to provision the directory. Services ServiceBindings }
Directory is a content-addressed directory.
func NewDirectory ¶
func NewDirectory(query *Query, def *pb.Definition, dir string, platform Platform, services ServiceBindings) *Directory
func NewDirectorySt ¶ added in v0.5.2
func NewScratchDirectory ¶ added in v0.6.3
func (*Directory) AsBlob ¶ added in v0.9.8
func (dir *Directory) AsBlob( ctx context.Context, srv *dagql.Server, ) (inst dagql.Instance[*Directory], rerr error)
AsBlob converts this directory into a stable content addressed blob, valid for the duration of the current session. Currently only used internally to support local module sources.
func (*Directory) Clone ¶ added in v0.5.1
Clone returns a deep copy of the container suitable for modifying in a WithXXX method.
func (*Directory) Glob ¶ added in v0.9.1
Glob returns a list of files that matches the given pattern.
Note(TomChv): Instead of handling the recursive manually, we could update cacheutil.ReadDir so it will only mount and unmount the filesystem one time. However, this requires to maintain buildkit code and is not mandatory for now until we hit performances issues.
func (*Directory) PBDefinitions ¶ added in v0.8.8
func (*Directory) PipelinePath ¶ added in v0.5.2
func (*Directory) StateWithSourcePath ¶ added in v0.5.1
func (*Directory) TypeDescription ¶ added in v0.9.7
func (*Directory) WithDirectory ¶
func (*Directory) WithFiles ¶ added in v0.9.10
func (dir *Directory) WithFiles( ctx context.Context, destDir string, src []*File, permissions *int, owner *Ownership, ) (*Directory, error)
TODO: address https://github.com/dagger/dagger/pull/6556/files#r1482830091
func (*Directory) WithNewDirectory ¶ added in v0.3.3
func (*Directory) WithNewFile ¶
func (*Directory) WithPipeline ¶ added in v0.5.1
func (*Directory) WithTimestamps ¶ added in v0.3.8
type DirectoryID ¶
type DynamicID ¶ added in v0.9.7
type DynamicID struct {
// contains filtered or unexported fields
}
func (DynamicID) DecodeInput ¶ added in v0.9.7
func (DynamicID) Decoder ¶ added in v0.9.7
func (d DynamicID) Decoder() dagql.InputDecoder
func (DynamicID) MarshalJSON ¶ added in v0.9.7
type FieldTypeDef ¶ added in v0.8.8
type FieldTypeDef struct { Name string `field:"true" doc:"The name of the field in lowerCamelCase format."` Description string `field:"true" doc:"A doc string for the field, if any."` TypeDef *TypeDef `field:"true" doc:"The type of the field."` // The original name of the object as provided by the SDK that defined it, used // when invoking the SDK so it doesn't need to think as hard about case conversions OriginalName string }
func (FieldTypeDef) Clone ¶ added in v0.8.8
func (typeDef FieldTypeDef) Clone() *FieldTypeDef
func (*FieldTypeDef) Type ¶ added in v0.9.7
func (*FieldTypeDef) Type() *ast.Type
func (*FieldTypeDef) TypeDescription ¶ added in v0.9.7
func (*FieldTypeDef) TypeDescription() string
type File ¶
type File struct { Query *Query LLB *pb.Definition `json:"llb"` File string `json:"file"` Platform Platform `json:"platform"` // Services necessary to provision the file. Services ServiceBindings `json:"services,omitempty"` }
File is a content-addressed file.
func NewFile ¶
func NewFile(query *Query, def *pb.Definition, file string, platform Platform, services ServiceBindings) *File
func NewFileWithContents ¶ added in v0.9.2
func (*File) Clone ¶ added in v0.5.1
Clone returns a deep copy of the container suitable for modifying in a WithXXX method.
func (*File) PBDefinitions ¶ added in v0.8.8
func (*File) PipelinePath ¶ added in v0.5.2
func (*File) TypeDescription ¶ added in v0.9.7
type Function ¶ added in v0.8.8
type Function struct { // Name is the standardized name of the function (lowerCamelCase), as used for the resolver in the graphql schema Name string `field:"true" doc:"The name of the function."` Description string `field:"true" doc:"A doc string for the function, if any."` Args []*FunctionArg `field:"true" doc:"Arguments accepted by the function, if any."` ReturnType *TypeDef `field:"true" doc:"The type returned by the function."` // OriginalName of the parent object ParentOriginalName string // The original name of the function as provided by the SDK that defined it, used // when invoking the SDK so it doesn't need to think as hard about case conversions OriginalName string }
func NewFunction ¶ added in v0.8.8
func (*Function) IsSubtypeOf ¶ added in v0.9.6
func (*Function) LookupArg ¶ added in v0.9.7
func (fn *Function) LookupArg(name string) (*FunctionArg, bool)
func (*Function) TypeDescription ¶ added in v0.9.7
func (*Function) WithDescription ¶ added in v0.8.8
type FunctionArg ¶ added in v0.8.8
type FunctionArg struct { // Name is the standardized name of the argument (lowerCamelCase), as used for the resolver in the graphql schema Name string `field:"true" doc:"The name of the argument in lowerCamelCase format."` Description string `field:"true" doc:"A doc string for the argument, if any."` TypeDef *TypeDef `field:"true" doc:"The type of the argument."` DefaultValue JSON `field:"true" doc:"A default value to use for this argument when not explicitly set by the caller, if any."` // The original name of the argument as provided by the SDK that defined it. OriginalName string }
func (FunctionArg) Clone ¶ added in v0.8.8
func (arg FunctionArg) Clone() *FunctionArg
func (*FunctionArg) Type ¶ added in v0.9.7
func (*FunctionArg) Type() *ast.Type
Type returns the GraphQL FunctionArg! type.
func (*FunctionArg) TypeDescription ¶ added in v0.9.7
func (*FunctionArg) TypeDescription() string
type FunctionArgID ¶ added in v0.9.4
type FunctionArgID = dagql.ID[*FunctionArg]
type FunctionCall ¶ added in v0.8.8
type FunctionCall struct { Query *Query Name string `field:"true" doc:"The name of the function being called."` ParentName string `` /* 154-byte string literal not displayed */ Parent JSON `` /* 155-byte string literal not displayed */ InputArgs []*FunctionCallArgValue `field:"true" doc:"The argument values the function is being invoked with."` }
func (*FunctionCall) ReturnValue ¶ added in v0.9.7
func (fnCall *FunctionCall) ReturnValue(ctx context.Context, val JSON) error
func (*FunctionCall) Type ¶ added in v0.9.7
func (*FunctionCall) Type() *ast.Type
func (*FunctionCall) TypeDescription ¶ added in v0.9.7
func (*FunctionCall) TypeDescription() string
type FunctionCallArgValue ¶ added in v0.9.7
type FunctionCallArgValue struct { Name string `field:"true" doc:"The name of the argument."` Value JSON `field:"true" doc:"The value of the argument represented as a JSON serialized string."` }
func (*FunctionCallArgValue) Type ¶ added in v0.9.7
func (*FunctionCallArgValue) Type() *ast.Type
func (*FunctionCallArgValue) TypeDescription ¶ added in v0.9.7
func (*FunctionCallArgValue) TypeDescription() string
type FunctionID ¶ added in v0.8.8
type GeneratedCode ¶ added in v0.8.8
type GeneratedCode struct { Code dagql.Instance[*Directory] `field:"true" doc:"The directory containing the generated code."` VCSGeneratedPaths []string `field:"true" name:"vcsGeneratedPaths" doc:"List of paths to mark generated in version control (i.e. .gitattributes)."` VCSIgnoredPaths []string `field:"true" name:"vcsIgnoredPaths" doc:"List of paths to ignore in version control (i.e. .gitignore)."` }
func NewGeneratedCode ¶ added in v0.9.0
func NewGeneratedCode(code dagql.Instance[*Directory]) *GeneratedCode
func (GeneratedCode) Clone ¶ added in v0.8.8
func (code GeneratedCode) Clone() *GeneratedCode
func (*GeneratedCode) PBDefinitions ¶ added in v0.9.7
func (code *GeneratedCode) PBDefinitions(ctx context.Context) ([]*pb.Definition, error)
func (*GeneratedCode) Type ¶ added in v0.9.7
func (*GeneratedCode) Type() *ast.Type
func (*GeneratedCode) TypeDescription ¶ added in v0.9.7
func (*GeneratedCode) TypeDescription() string
func (*GeneratedCode) WithVCSGeneratedPaths ¶ added in v0.8.8
func (code *GeneratedCode) WithVCSGeneratedPaths(paths []string) *GeneratedCode
func (*GeneratedCode) WithVCSIgnoredPaths ¶ added in v0.8.8
func (code *GeneratedCode) WithVCSIgnoredPaths(paths []string) *GeneratedCode
type GeneratedCodeID ¶ added in v0.8.8
type GeneratedCodeID = dagql.ID[*GeneratedCode]
type GitModuleSource ¶ added in v0.9.8
type GitModuleSource struct { Version string `field:"true" doc:"The specified version of the git repo this source points to."` Commit string `field:"true" doc:"The resolved commit of the git repo this source points to."` URLParent string RootSubpath string `` /* 200-byte string literal not displayed */ ContextDirectory dagql.Instance[*Directory] `field:"true" doc:"The directory containing everything needed to load load and use the module."` }
func (GitModuleSource) Clone ¶ added in v0.9.8
func (src GitModuleSource) Clone() *GitModuleSource
func (*GitModuleSource) CloneURL ¶ added in v0.9.8
func (src *GitModuleSource) CloneURL() string
func (*GitModuleSource) HTMLURL ¶ added in v0.9.8
func (src *GitModuleSource) HTMLURL() string
func (*GitModuleSource) PBDefinitions ¶ added in v0.9.9
func (src *GitModuleSource) PBDefinitions(ctx context.Context) ([]*pb.Definition, error)
func (*GitModuleSource) RefString ¶ added in v0.9.9
func (src *GitModuleSource) RefString() string
func (*GitModuleSource) Symbolic ¶ added in v0.9.8
func (src *GitModuleSource) Symbolic() string
func (*GitModuleSource) Type ¶ added in v0.9.8
func (src *GitModuleSource) Type() *ast.Type
func (*GitModuleSource) TypeDescription ¶ added in v0.9.8
func (src *GitModuleSource) TypeDescription() string
type GitModuleSourceID ¶ added in v0.9.8
type GitModuleSourceID = dagql.ID[*GitModuleSource]
type GitRef ¶ added in v0.9.1
type GitRef struct { Query *Query Ref string `json:"ref"` Repo *GitRepository `json:"repository"` }
func (*GitRef) TypeDescription ¶ added in v0.9.7
type GitRepository ¶ added in v0.9.4
type GitRepository struct { Query *Query URL string `json:"url"` KeepGitDir bool `json:"keepGitDir"` SSHKnownHosts string `json:"sshKnownHosts"` SSHAuthSocket *Socket `json:"sshAuthSocket"` Services ServiceBindings `json:"services"` Platform Platform `json:"platform,omitempty"` }
func (*GitRepository) Type ¶ added in v0.9.7
func (*GitRepository) Type() *ast.Type
func (*GitRepository) TypeDescription ¶ added in v0.9.7
func (*GitRepository) TypeDescription() string
type GitRepositoryID ¶ added in v0.9.4
type GitRepositoryID = dagql.ID[*GitRepository]
type HasPBDefinitions ¶ added in v0.8.8
type HasPBDefinitions interface {
PBDefinitions(context.Context) ([]*pb.Definition, error)
}
type Host ¶ added in v0.3.3
type Host struct {
Query *Query
}
func (*Host) SetSecretFile ¶ added in v0.9.7
func (*Host) TypeDescription ¶ added in v0.9.7
type ImageLayerCompression ¶ added in v0.5.3
type ImageLayerCompression string
func (ImageLayerCompression) Decoder ¶ added in v0.9.7
func (proto ImageLayerCompression) Decoder() dagql.InputDecoder
func (ImageLayerCompression) ToLiteral ¶ added in v0.9.7
func (proto ImageLayerCompression) ToLiteral() *idproto.Literal
func (ImageLayerCompression) Type ¶ added in v0.9.7
func (proto ImageLayerCompression) Type() *ast.Type
func (ImageLayerCompression) TypeDescription ¶ added in v0.9.7
func (proto ImageLayerCompression) TypeDescription() string
type ImageMediaTypes ¶ added in v0.6.4
type ImageMediaTypes string
func (ImageMediaTypes) Decoder ¶ added in v0.9.7
func (proto ImageMediaTypes) Decoder() dagql.InputDecoder
func (ImageMediaTypes) ToLiteral ¶ added in v0.9.7
func (proto ImageMediaTypes) ToLiteral() *idproto.Literal
func (ImageMediaTypes) Type ¶ added in v0.9.7
func (proto ImageMediaTypes) Type() *ast.Type
func (ImageMediaTypes) TypeDescription ¶ added in v0.9.7
func (proto ImageMediaTypes) TypeDescription() string
type InputTypeDef ¶ added in v0.9.8
type InputTypeDef struct { Name string `field:"true" doc:"The name of the input object."` Fields []*FieldTypeDef `field:"true" doc:"Static fields defined on this input object, if any."` }
func (InputTypeDef) Clone ¶ added in v0.9.8
func (typeDef InputTypeDef) Clone() *InputTypeDef
func (*InputTypeDef) ToInputObjectSpec ¶ added in v0.9.8
func (typeDef *InputTypeDef) ToInputObjectSpec() dagql.InputObjectSpec
func (*InputTypeDef) Type ¶ added in v0.9.8
func (*InputTypeDef) Type() *ast.Type
func (*InputTypeDef) TypeDescription ¶ added in v0.9.8
func (*InputTypeDef) TypeDescription() string
type InterfaceAnnotatedValue ¶ added in v0.9.7
type InterfaceAnnotatedValue struct { TypeDef *InterfaceTypeDef IfaceType *InterfaceType Fields map[string]any UnderlyingType ModType }
func (*InterfaceAnnotatedValue) PBDefinitions ¶ added in v0.9.7
func (iface *InterfaceAnnotatedValue) PBDefinitions(ctx context.Context) ([]*pb.Definition, error)
func (*InterfaceAnnotatedValue) Type ¶ added in v0.9.7
func (iface *InterfaceAnnotatedValue) Type() *ast.Type
func (*InterfaceAnnotatedValue) TypeDescription ¶ added in v0.9.7
func (iface *InterfaceAnnotatedValue) TypeDescription() string
type InterfaceType ¶ added in v0.9.7
type InterfaceType struct {
// contains filtered or unexported fields
}
func (*InterfaceType) ConvertFromSDKResult ¶ added in v0.9.7
func (*InterfaceType) ConvertToSDKInput ¶ added in v0.9.7
func (*InterfaceType) SourceMod ¶ added in v0.9.7
func (iface *InterfaceType) SourceMod() Mod
func (*InterfaceType) TypeDef ¶ added in v0.9.7
func (iface *InterfaceType) TypeDef() *TypeDef
type InterfaceTypeDef ¶ added in v0.9.6
type InterfaceTypeDef struct { // Name is the standardized name of the interface (CamelCase), as used for the interface in the graphql schema Name string `field:"true" doc:"The name of the interface."` Description string `field:"true" doc:"The doc string for the interface, if any."` Functions []*Function `field:"true" doc:"Functions defined on this interface, if any."` // SourceModuleName is currently only set when returning the TypeDef from the Objects field on Module SourceModuleName string `field:"true" doc:"If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise."` // The original name of the interface as provided by the SDK that defined it, used // when invoking the SDK so it doesn't need to think as hard about case conversions OriginalName string }
func NewInterfaceTypeDef ¶ added in v0.9.6
func NewInterfaceTypeDef(name, description string) *InterfaceTypeDef
func (InterfaceTypeDef) Clone ¶ added in v0.9.6
func (iface InterfaceTypeDef) Clone() *InterfaceTypeDef
func (*InterfaceTypeDef) IsSubtypeOf ¶ added in v0.9.6
func (iface *InterfaceTypeDef) IsSubtypeOf(otherIface *InterfaceTypeDef) bool
func (*InterfaceTypeDef) Type ¶ added in v0.9.7
func (*InterfaceTypeDef) Type() *ast.Type
func (*InterfaceTypeDef) TypeDescription ¶ added in v0.9.7
func (*InterfaceTypeDef) TypeDescription() string
type JSON ¶ added in v0.9.7
type JSON json.RawMessage
func (JSON) DecodeInput ¶ added in v0.9.7
func (JSON) Decoder ¶ added in v0.9.7
func (p JSON) Decoder() dagql.InputDecoder
func (JSON) MarshalJSON ¶ added in v0.9.7
func (JSON) TypeDescription ¶ added in v0.9.7
type ListType ¶ added in v0.9.7
func (*ListType) ConvertFromSDKResult ¶ added in v0.9.7
func (*ListType) ConvertToSDKInput ¶ added in v0.9.7
type ListTypeDef ¶ added in v0.8.8
type ListTypeDef struct {
ElementTypeDef *TypeDef `field:"true" doc:"The type of the elements in the list."`
}
func (ListTypeDef) Clone ¶ added in v0.8.8
func (typeDef ListTypeDef) Clone() *ListTypeDef
func (*ListTypeDef) Type ¶ added in v0.9.7
func (*ListTypeDef) Type() *ast.Type
func (*ListTypeDef) TypeDescription ¶ added in v0.9.7
func (*ListTypeDef) TypeDescription() string
type LocalModuleSource ¶ added in v0.9.8
type LocalModuleSource struct { RootSubpath string `` /* 200-byte string literal not displayed */ ContextDirectory dagql.Instance[*Directory] `field:"true" doc:"The directory containing everything needed to load load and use the module."` }
func (LocalModuleSource) Clone ¶ added in v0.9.8
func (src LocalModuleSource) Clone() *LocalModuleSource
func (*LocalModuleSource) PBDefinitions ¶ added in v0.9.9
func (src *LocalModuleSource) PBDefinitions(ctx context.Context) ([]*pb.Definition, error)
func (*LocalModuleSource) RefString ¶ added in v0.9.9
func (src *LocalModuleSource) RefString() string
func (*LocalModuleSource) Symbolic ¶ added in v0.9.8
func (src *LocalModuleSource) Symbolic() string
func (*LocalModuleSource) Type ¶ added in v0.9.8
func (src *LocalModuleSource) Type() *ast.Type
func (*LocalModuleSource) TypeDescription ¶ added in v0.9.8
func (src *LocalModuleSource) TypeDescription() string
type LocalModuleSourceID ¶ added in v0.9.8
type LocalModuleSourceID = dagql.ID[*LocalModuleSource]
type Mod ¶ added in v0.9.7
type Mod interface { // The name of the module Name() string // The direct dependencies of this module Dependencies() []Mod // TODO describe Install(context.Context, *dagql.Server) error // ModTypeFor returns the ModType for the given typedef based on this module's schema. // The returned type will have any namespacing already applied. // If checkDirectDeps is true, then its direct dependencies will also be checked. ModTypeFor(ctx context.Context, typeDef *TypeDef, checkDirectDeps bool) (ModType, bool, error) // All the TypeDefs exposed by this module (does not include dependencies) TypeDefs(ctx context.Context) ([]*TypeDef, error) }
Mod is a module in loaded into the server's DAG of modules; it's the vertex type of the DAG. It's an interface so we can abstract over user modules and core and treat them the same.
type ModDeps ¶ added in v0.9.7
type ModDeps struct { Mods []Mod // TODO hide // contains filtered or unexported fields }
ModDeps represents a set of dependencies for a module or for a caller depending on a particular set of modules to be served.
func NewModDeps ¶ added in v0.9.7
func (*ModDeps) ModTypeFor ¶ added in v0.9.7
Search the deps for the given type def, returning the ModType if found. This does not recurse to transitive dependencies; it only returns types directly exposed by the schema of the top-level deps.
func (*ModDeps) Schema ¶ added in v0.9.7
The combined schema exposed by each mod in this set of dependencies
func (*ModDeps) SchemaIntrospectionJSON ¶ added in v0.9.7
The introspection json for combined schema exposed by each mod in this set of dependencies
type ModType ¶ added in v0.9.7
type ModType interface { // ConvertFromSDKResult converts a value returned from an SDK into values // expected by the server, including conversion of IDs to their "unpacked" // objects ConvertFromSDKResult(ctx context.Context, value any) (dagql.Typed, error) // ConvertToSDKInput converts a value from the server into a value expected // by the SDK, which may include converting objects to their IDs ConvertToSDKInput(ctx context.Context, value dagql.Typed) (any, error) // SourceMod is the module in which this type was originally defined SourceMod() Mod // The core API TypeDef representation of this type TypeDef() *TypeDef }
ModType wraps the core TypeDef type with schema specific concerns like ID conversion and tracking of the module in which the type was originally defined.
type Module ¶ added in v0.8.8
type Module struct { Query *Query // The source of the module Source dagql.Instance[*ModuleSource] `field:"true" name:"source" doc:"The source for the module."` // The name of the module NameField string `field:"true" name:"name" doc:"The name of the module"` // The original name of the module set in its configuration file (or first configured via withName). // Different than NameField when a different name was specified for the module via a dependency. OriginalName string // The origin sdk of the module set in its configuration file (or first configured via withSDK). OriginalSDK string // The doc string of the module, if any Description string `field:"true" doc:"The doc string of the module, if any"` // The module's SDKConfig, as set in the module config file SDKConfig string `` /* 157-byte string literal not displayed */ GeneratedContextDirectory dagql.Instance[*Directory] `` /* 139-byte string literal not displayed */ // Dependencies as configured by the module DependencyConfig []*ModuleDependency `field:"true" doc:"The dependencies as configured by the module."` // The module's loaded dependencies, not yet initialized DependenciesField []dagql.Instance[*Module] `field:"true" name:"dependencies" doc:"Modules used by this module."` // Deps contains the module's dependency DAG. Deps *ModDeps // Runtime is the container that runs the module's entrypoint. It will fail to execute if the module doesn't compile. Runtime *Container `` /* 137-byte string literal not displayed */ // The module's objects ObjectDefs []*TypeDef `field:"true" name:"objects" doc:"Objects served by this module."` // The module's interfaces InterfaceDefs []*TypeDef `field:"true" name:"interfaces" doc:"Interfaces served by this module."` // InstanceID is the ID of the initialized module. InstanceID *idproto.ID }
func (*Module) Dependencies ¶ added in v0.8.8
func (*Module) DependencySchemaIntrospectionJSON ¶ added in v0.9.7
func (*Module) Initialize ¶ added in v0.9.7
func (*Module) ModTypeFor ¶ added in v0.9.7
func (*Module) PBDefinitions ¶ added in v0.8.8
func (*Module) TypeDescription ¶ added in v0.9.7
func (*Module) WithDescription ¶ added in v0.9.8
func (*Module) WithInterface ¶ added in v0.9.6
type ModuleDependency ¶ added in v0.9.8
type ModuleDependency struct { Source dagql.Instance[*ModuleSource] `field:"true" name:"source" doc:"The source for the dependency module."` Name string `field:"true" name:"name" doc:"The name of the dependency module."` }
func (ModuleDependency) Clone ¶ added in v0.9.8
func (dep ModuleDependency) Clone() *ModuleDependency
func (*ModuleDependency) Type ¶ added in v0.9.8
func (*ModuleDependency) Type() *ast.Type
func (*ModuleDependency) TypeDescription ¶ added in v0.9.8
func (*ModuleDependency) TypeDescription() string
type ModuleDependencyID ¶ added in v0.9.8
type ModuleDependencyID = dagql.ID[*ModuleDependency]
type ModuleFunction ¶ added in v0.9.7
type ModuleFunction struct {
// contains filtered or unexported fields
}
func (*ModuleFunction) ArgType ¶ added in v0.9.7
func (fn *ModuleFunction) ArgType(argName string) (ModType, error)
func (*ModuleFunction) ReturnType ¶ added in v0.9.7
func (fn *ModuleFunction) ReturnType() (ModType, error)
type ModuleObject ¶ added in v0.9.7
type ModuleObject struct { Module *Module TypeDef *ObjectTypeDef Fields map[string]any }
func (*ModuleObject) PBDefinitions ¶ added in v0.9.7
func (obj *ModuleObject) PBDefinitions(ctx context.Context) ([]*pb.Definition, error)
func (*ModuleObject) Type ¶ added in v0.9.7
func (obj *ModuleObject) Type() *ast.Type
func (*ModuleObject) TypeDescription ¶ added in v0.9.7
func (obj *ModuleObject) TypeDescription() string
type ModuleObjectType ¶ added in v0.9.7
type ModuleObjectType struct {
// contains filtered or unexported fields
}
func (*ModuleObjectType) ConvertFromSDKResult ¶ added in v0.9.7
func (*ModuleObjectType) ConvertToSDKInput ¶ added in v0.9.7
func (*ModuleObjectType) GetCallable ¶ added in v0.9.7
func (*ModuleObjectType) SourceMod ¶ added in v0.9.7
func (t *ModuleObjectType) SourceMod() Mod
func (*ModuleObjectType) TypeDef ¶ added in v0.9.7
func (t *ModuleObjectType) TypeDef() *TypeDef
type ModuleSource ¶ added in v0.9.8
type ModuleSource struct { Query *Query Kind ModuleSourceKind `field:"true" name:"kind" doc:"The kind of source (e.g. local, git, etc.)"` AsLocalSource dagql.Nullable[*LocalModuleSource] `field:"true" doc:"If the source is of kind local, the local source representation of it."` AsGitSource dagql.Nullable[*GitModuleSource] `field:"true" doc:"If the source is a of kind git, the git source representation of it."` // Settings that can be used to initialize or override the source's configuration WithName string WithDependencies []dagql.Instance[*ModuleDependency] WithSDK string WithSourceSubpath string }
func (ModuleSource) Clone ¶ added in v0.9.8
func (src ModuleSource) Clone() *ModuleSource
func (*ModuleSource) ContextDirectory ¶ added in v0.9.9
func (src *ModuleSource) ContextDirectory() (inst dagql.Instance[*Directory], err error)
func (*ModuleSource) ModuleConfig ¶ added in v0.9.9
func (src *ModuleSource) ModuleConfig(ctx context.Context) (*modules.ModuleConfig, bool, error)
func (*ModuleSource) ModuleName ¶ added in v0.9.8
func (src *ModuleSource) ModuleName(ctx context.Context) (string, error)
func (*ModuleSource) ModuleOriginalName ¶ added in v0.9.9
func (src *ModuleSource) ModuleOriginalName(ctx context.Context) (string, error)
func (*ModuleSource) PBDefinitions ¶ added in v0.9.8
func (src *ModuleSource) PBDefinitions(ctx context.Context) ([]*pb.Definition, error)
func (*ModuleSource) RefString ¶ added in v0.9.8
func (src *ModuleSource) RefString() (string, error)
func (*ModuleSource) SDK ¶ added in v0.9.9
func (src *ModuleSource) SDK(ctx context.Context) (string, error)
func (*ModuleSource) SourceRootSubpath ¶ added in v0.9.9
func (src *ModuleSource) SourceRootSubpath() (string, error)
func (*ModuleSource) SourceSubpath ¶ added in v0.9.9
func (src *ModuleSource) SourceSubpath(ctx context.Context) (string, error)
func (*ModuleSource) SourceSubpathWithDefault ¶ added in v0.9.9
func (src *ModuleSource) SourceSubpathWithDefault(ctx context.Context) (string, error)
SourceSubpathWithDefault is the same as SourceSubpath, but it will default to the root subpath if the module has no configuration.
func (*ModuleSource) Symbolic ¶ added in v0.9.8
func (src *ModuleSource) Symbolic() (string, error)
func (*ModuleSource) Type ¶ added in v0.9.8
func (src *ModuleSource) Type() *ast.Type
func (*ModuleSource) TypeDescription ¶ added in v0.9.8
func (src *ModuleSource) TypeDescription() string
type ModuleSourceID ¶ added in v0.9.8
type ModuleSourceID = dagql.ID[*ModuleSource]
type ModuleSourceKind ¶ added in v0.9.8
type ModuleSourceKind string
func (ModuleSourceKind) Decoder ¶ added in v0.9.8
func (proto ModuleSourceKind) Decoder() dagql.InputDecoder
func (ModuleSourceKind) ToLiteral ¶ added in v0.9.8
func (proto ModuleSourceKind) ToLiteral() *idproto.Literal
func (ModuleSourceKind) Type ¶ added in v0.9.8
func (proto ModuleSourceKind) Type() *ast.Type
func (ModuleSourceKind) TypeDescription ¶ added in v0.9.8
func (proto ModuleSourceKind) TypeDescription() string
type NetworkProtocol ¶ added in v0.3.13
type NetworkProtocol string
NetworkProtocol is a GraphQL enum type.
func (NetworkProtocol) Decoder ¶ added in v0.9.7
func (proto NetworkProtocol) Decoder() dagql.InputDecoder
func (NetworkProtocol) Network ¶ added in v0.3.13
func (proto NetworkProtocol) Network() string
Network returns the value appropriate for the "network" argument to Go net.Dial, and for appending to the port number to form the key for the ExposedPorts object in the OCI image config.
func (NetworkProtocol) ToLiteral ¶ added in v0.9.7
func (proto NetworkProtocol) ToLiteral() *idproto.Literal
func (NetworkProtocol) Type ¶ added in v0.9.7
func (proto NetworkProtocol) Type() *ast.Type
func (NetworkProtocol) TypeDescription ¶ added in v0.9.7
func (proto NetworkProtocol) TypeDescription() string
type NullableType ¶ added in v0.9.7
func (*NullableType) ConvertFromSDKResult ¶ added in v0.9.7
func (*NullableType) ConvertToSDKInput ¶ added in v0.9.7
func (*NullableType) SourceMod ¶ added in v0.9.7
func (t *NullableType) SourceMod() Mod
func (*NullableType) TypeDef ¶ added in v0.9.7
func (t *NullableType) TypeDef() *TypeDef
type ObjectTypeDef ¶ added in v0.8.8
type ObjectTypeDef struct { // Name is the standardized name of the object (CamelCase), as used for the object in the graphql schema Name string `field:"true" doc:"The name of the object."` Description string `field:"true" doc:"The doc string for the object, if any."` Fields []*FieldTypeDef `field:"true" doc:"Static fields defined on this object, if any."` Functions []*Function `field:"true" doc:"Functions defined on this object, if any."` Constructor dagql.Nullable[*Function] `field:"true" doc:"The function used to construct new instances of this object, if any"` // SourceModuleName is currently only set when returning the TypeDef from the Objects field on Module SourceModuleName string `field:"true" doc:"If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise."` // The original name of the object as provided by the SDK that defined it, used // when invoking the SDK so it doesn't need to think as hard about case conversions OriginalName string }
func NewObjectTypeDef ¶ added in v0.9.1
func NewObjectTypeDef(name, description string) *ObjectTypeDef
func (ObjectTypeDef) Clone ¶ added in v0.8.8
func (obj ObjectTypeDef) Clone() *ObjectTypeDef
func (*ObjectTypeDef) FieldByName ¶ added in v0.8.8
func (obj *ObjectTypeDef) FieldByName(name string) (*FieldTypeDef, bool)
func (*ObjectTypeDef) FieldByOriginalName ¶ added in v0.9.7
func (obj *ObjectTypeDef) FieldByOriginalName(name string) (*FieldTypeDef, bool)
func (*ObjectTypeDef) FunctionByName ¶ added in v0.8.8
func (obj *ObjectTypeDef) FunctionByName(name string) (*Function, bool)
func (*ObjectTypeDef) IsSubtypeOf ¶ added in v0.9.6
func (obj *ObjectTypeDef) IsSubtypeOf(iface *InterfaceTypeDef) bool
func (*ObjectTypeDef) Type ¶ added in v0.9.7
func (*ObjectTypeDef) Type() *ast.Type
func (*ObjectTypeDef) TypeDescription ¶ added in v0.9.7
func (*ObjectTypeDef) TypeDescription() string
type Ownership ¶ added in v0.5.1
Ownership contains a UID/GID pair resolved from a user/group name or ID pair provided via the API. It primarily exists to distinguish an unspecified ownership from UID/GID 0 (root) ownership.
func (Ownership) Opt ¶ added in v0.5.1
func (owner Ownership) Opt() llb.ChownOption
type Platform ¶ added in v0.9.7
func (Platform) DecodeInput ¶ added in v0.9.7
func (Platform) Decoder ¶ added in v0.9.7
func (p Platform) Decoder() dagql.InputDecoder
func (Platform) MarshalJSON ¶ added in v0.9.7
func (Platform) TypeDescription ¶ added in v0.9.7
type Port ¶ added in v0.8.5
type Port struct { Port int `field:"true" doc:"The port number."` Protocol NetworkProtocol `field:"true" doc:"The transport layer protocol."` Description *string `field:"true" doc:"The port description."` ExperimentalSkipHealthcheck bool `field:"true" doc:"Skip the health check when run as a service."` }
Port configures a port to exposed from a container or service.
func (Port) TypeDescription ¶ added in v0.9.7
type PortForward ¶ added in v0.9.0
type PortForward struct { Frontend *int `doc:"Port to expose to clients. If unspecified, a default will be chosen."` Backend int `doc:"Destination port for traffic."` Protocol NetworkProtocol `doc:"Transport layer protocol to use for traffic." default:"TCP"` }
func (PortForward) FrontendOrBackendPort ¶ added in v0.9.0
func (pf PortForward) FrontendOrBackendPort() int
func (PortForward) TypeDescription ¶ added in v0.9.7
func (pf PortForward) TypeDescription() string
func (PortForward) TypeName ¶ added in v0.9.7
func (pf PortForward) TypeName() string
type PrimitiveType ¶ added in v0.9.7
type PrimitiveType struct {
Def *TypeDef
}
PrimitiveType are the basic types like string, int, bool, void, etc.
func (*PrimitiveType) ConvertFromSDKResult ¶ added in v0.9.7
func (*PrimitiveType) ConvertToSDKInput ¶ added in v0.9.7
func (*PrimitiveType) SourceMod ¶ added in v0.9.7
func (t *PrimitiveType) SourceMod() Mod
func (*PrimitiveType) TypeDef ¶ added in v0.9.7
func (t *PrimitiveType) TypeDef() *TypeDef
type Query ¶ added in v0.3.10
type Query struct { Buildkit *buildkit.Client // The current pipeline. Pipeline pipeline.Path ProgrockSocketPath string Services *Services Secrets *SecretStore Auth *auth.RegistryAuthProvider OCIStore content.Store LeaseManager *leaseutil.Manager // The default platform. Platform Platform // The default deps of every user module (currently just core) DefaultDeps *ModDeps // The DagQL query cache. Cache dagql.Cache // contains filtered or unexported fields }
Query forms the root of the DAG and houses all necessary state and dependencies for evaluating queries.
func (*Query) ClientCallContext ¶ added in v0.9.7
func (q *Query) ClientCallContext(clientDigest digest.Digest) (*ClientCallContext, bool)
func (*Query) CurrentFunctionCall ¶ added in v0.9.7
func (q *Query) CurrentFunctionCall(ctx context.Context) (*FunctionCall, error)
func (*Query) CurrentModule ¶ added in v0.9.7
func (*Query) CurrentServedDeps ¶ added in v0.9.7
func (*Query) IDDeps ¶ added in v0.9.7
IDDeps loads the module dependencies of a given ID.
The returned ModDeps extends the inner DefaultDeps with all modules found in the ID, loaded by using the DefaultDeps schema.
func (*Query) InstallDefaultClientContext ¶ added in v0.9.7
func (*Query) MuxEndpoint ¶ added in v0.9.7
func (*Query) MuxEndpoints ¶ added in v0.9.7
func (*Query) NewContainer ¶ added in v0.9.7
func (*Query) NewContainerService ¶ added in v0.9.7
func (*Query) NewHostService ¶ added in v0.9.7
func (q *Query) NewHostService(upstream string, ports []PortForward) *Service
func (*Query) NewTunnelService ¶ added in v0.9.7
func (*Query) RegisterFunctionCall ¶ added in v0.9.7
func (*Query) ServeModuleToMainClient ¶ added in v0.9.7
func (*Query) TypeDescription ¶ added in v0.9.7
type RunningService ¶ added in v0.8.5
type RunningService struct { // Service is the service that has been started. Service *Service // Key is the unique identifier for the service. Key ServiceKey // Host is the hostname used to reach the service. Host string // Ports lists the ports bound by the service. // // For a Container service, this is simply the list of exposed ports. // // For a TunnelService, this lists the configured port forwards with any // empty or 0 frontend ports resolved to their randomly selected host port. // // For a HostService, this lists the configured port forwards with any empty // or 0 frontend ports set to the same as the backend port. Ports []Port // Stop forcibly stops the service. It is normally called after all clients // have detached, but may also be called manually by the user. Stop func(ctx context.Context, force bool) error // Block until the service has exited or the provided context is canceled. Wait func(ctx context.Context) error }
RunningService represents a service that is actively running.
type SDK ¶ added in v0.9.7
type SDK interface { /* Codegen generates code for the module at the given source directory and subpath. The Code field of the returned GeneratedCode object should be the generated contents of the module sourceDirSubpath, in the case where that's different than the root of the sourceDir. The provided Module is not fully initialized; the Runtime field will not be set yet. */ Codegen(context.Context, *ModDeps, dagql.Instance[*ModuleSource]) (*GeneratedCode, error) /* Runtime returns a container that is used to execute module code at runtime in the Dagger engine. The provided Module is not fully initialized; the Runtime field will not be set yet. */ Runtime(context.Context, *ModDeps, dagql.Instance[*ModuleSource]) (*Container, error) // Paths that should always be loaded from module sources using this SDK. Ensures that e.g. main.go // in the Go SDK is always loaded even if dagger.json has include settings that don't include it. RequiredPaths(context.Context) ([]string, error) }
An SDK is an implementation of the functionality needed to generate code for and execute a module.
There is one special SDK, the Go SDK, which is implemented in `goSDK` below. It's used as the "seed" for all other SDK implementations.
All other SDKs are themselves implemented as Modules, with Functions matching the two defined in this SDK interface.
An SDK Module needs to choose its own SDK for its implementation. This can be "well-known" built-in SDKs like "go", "python", etc. Or it can be any external module as specified with a module source ref string.
You can thus think of SDK Modules as a DAG of dependencies, with each SDK using a different SDK to implement its Module, with the Go SDK as the root of the DAG and the only one without any dependencies.
Built-in SDKs are also a bit special in that they come bundled w/ the engine container image, which allows them to be used without hard dependencies on the internet. They are loaded w/ the `loadBuiltinSDK` function below, which loads them as modules from the engine container.
type Secret ¶
type Secret struct { Query *Query // Name specifies the name of the secret. Name string `json:"name,omitempty"` }
Secret is a content-addressed secret.
func (*Secret) TypeDescription ¶ added in v0.9.7
type SecretStore ¶ added in v0.8.0
type SecretStore struct {
// contains filtered or unexported fields
}
func NewSecretStore ¶ added in v0.8.0
func NewSecretStore() *SecretStore
type SecretToScrubInfo ¶ added in v0.3.13
type SecretToScrubInfo struct { // Envs stores environment variable names that we need to scrub. Envs []string `json:"envs,omitempty"` // Files stores secret file paths that we need to scrub. Files []string `json:"files,omitempty"` }
SecretToScrubInfo stores the info to access secrets and scrub them from outputs.
type Service ¶ added in v0.3.13
type Service struct { Query *Query // Container is the container to run as a service. Container *Container `json:"container"` // TunnelUpstream is the service that this service is tunnelling to. TunnelUpstream *dagql.Instance[*Service] `json:"upstream,omitempty"` // TunnelPorts configures the port forwarding rules for the tunnel. TunnelPorts []PortForward `json:"tunnel_ports,omitempty"` // HostUpstream is the host address (i.e. hostname or IP) for the reverse // tunnel to request through the host. HostUpstream string `json:"reverse_tunnel_upstream_addr,omitempty"` // HostPorts configures the port forwarding rules for the host. HostPorts []PortForward `json:"host_ports,omitempty"` }
func (*Service) Clone ¶ added in v0.8.5
Clone returns a deep copy of the container suitable for modifying in a WithXXX method.
func (*Service) PipelinePath ¶ added in v0.8.5
PipelinePath returns the service's pipeline path.
func (*Service) StartAndTrack ¶ added in v0.9.7
func (*Service) TypeDescription ¶ added in v0.9.7
type ServiceBinding ¶ added in v0.8.5
type ServiceBindings ¶ added in v0.3.13
type ServiceBindings []ServiceBinding
func (*ServiceBindings) Merge ¶ added in v0.3.13
func (bndp *ServiceBindings) Merge(other ServiceBindings)
type ServiceKey ¶ added in v0.8.5
type ServiceKey struct { Digest digest.Digest ServerID string }
ServiceKey is a unique identifier for a service.
type Services ¶ added in v0.8.5
type Services struct {
// contains filtered or unexported fields
}
Services manages the lifecycle of services, ensuring the same service only runs once per client.
func NewServices ¶ added in v0.8.5
NewServices returns a new Services.
func (*Services) Detach ¶ added in v0.8.5
func (ss *Services) Detach(ctx context.Context, svc *RunningService)
Detach detaches from the given service. If the service is not running, it is a no-op. If the service is running, it is stopped if there are no other clients using it.
func (*Services) Get ¶ added in v0.8.5
Get returns the running service for the given service. If the service is starting, it waits for it and either returns the running service or an error if it failed to start. If the service is not running or starting, an error is returned.
func (*Services) Start ¶ added in v0.8.5
func (ss *Services) Start(ctx context.Context, id *idproto.ID, svc Startable) (*RunningService, error)
Start starts the given service, returning the running service. If the service is already running, it is returned immediately. If the service is already starting, it waits for it to finish and returns the running service. If the service failed to start, it tries again.
func (*Services) StartBindings ¶ added in v0.8.5
func (ss *Services) StartBindings(ctx context.Context, bindings ServiceBindings) (_ func(), _ []*RunningService, err error)
StartBindings starts each of the bound services in parallel and returns a function that will detach from all of them after 10 seconds.
func (*Services) Stop ¶ added in v0.8.5
Stop stops the given service. If the service is not running, it is a no-op.
func (*Services) StopClientServices ¶ added in v0.8.5
StopClientServices stops all of the services being run by the given client. It is called when a client is closing.
type Socket ¶ added in v0.3.7
type Socket struct { // Unix HostPath string `json:"host_path,omitempty"` // IP HostProtocol string `json:"host_protocol,omitempty"` HostAddr string `json:"host_addr,omitempty"` }
func NewHostIPSocket ¶ added in v0.9.7
func NewHostUnixSocket ¶ added in v0.9.7
func (*Socket) Server ¶ added in v0.3.7
func (socket *Socket) Server() (sshforward.SSHServer, error)
func (*Socket) TypeDescription ¶ added in v0.9.7
type Terminal ¶ added in v0.9.8
type Terminal struct {
Endpoint string `json:"endpoint"`
}
func (*Terminal) TypeDescription ¶ added in v0.9.8
func (*Terminal) WebsocketURL ¶ added in v0.9.8
type TypeDef ¶ added in v0.8.8
type TypeDef struct { Kind TypeDefKind `field:"true" doc:"The kind of type this is (e.g. primitive, list, object)."` Optional bool `field:"true" doc:"Whether this type can be set to null. Defaults to false."` AsList dagql.Nullable[*ListTypeDef] `field:"true" doc:"If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null."` AsObject dagql.Nullable[*ObjectTypeDef] `field:"true" doc:"If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null."` AsInterface dagql.Nullable[*InterfaceTypeDef] `field:"true" doc:"If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null."` AsInput dagql.Nullable[*InputTypeDef] `field:"true" doc:"If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null."` }
func (*TypeDef) IsSubtypeOf ¶ added in v0.9.6
func (*TypeDef) TypeDescription ¶ added in v0.9.7
func (*TypeDef) Underlying ¶ added in v0.9.4
func (*TypeDef) WithFunction ¶ added in v0.9.6
func (*TypeDef) WithInterface ¶ added in v0.9.6
func (*TypeDef) WithKind ¶ added in v0.8.8
func (typeDef *TypeDef) WithKind(kind TypeDefKind) *TypeDef
func (*TypeDef) WithListOf ¶ added in v0.8.8
func (*TypeDef) WithObject ¶ added in v0.8.8
func (*TypeDef) WithObjectConstructor ¶ added in v0.9.4
func (*TypeDef) WithObjectField ¶ added in v0.8.8
func (*TypeDef) WithOptional ¶ added in v0.8.8
type TypeDefKind ¶ added in v0.8.8
type TypeDefKind string
func (TypeDefKind) Decoder ¶ added in v0.9.7
func (k TypeDefKind) Decoder() dagql.InputDecoder
func (TypeDefKind) String ¶ added in v0.8.8
func (k TypeDefKind) String() string
func (TypeDefKind) ToLiteral ¶ added in v0.9.7
func (k TypeDefKind) ToLiteral() *idproto.Literal
func (TypeDefKind) Type ¶ added in v0.9.7
func (k TypeDefKind) Type() *ast.Type
func (TypeDefKind) TypeDescription ¶ added in v0.9.7
func (k TypeDefKind) TypeDescription() string
type UserModFunctionArg ¶ added in v0.9.7
type UserModFunctionArg struct {
// contains filtered or unexported fields
}
type Void ¶ added in v0.9.7
type Void struct{}
func (Void) Decoder ¶ added in v0.9.7
func (p Void) Decoder() dagql.InputDecoder
func (Void) TypeDescription ¶ added in v0.9.7
Source Files ¶
- c2h.go
- cache.go
- codegen.go
- container.go
- directory.go
- file.go
- git.go
- gqlformat.go
- healthcheck.go
- host.go
- ids.go
- interface.go
- json.go
- moddeps.go
- modfunc.go
- modtypes.go
- module.go
- modulesource.go
- net.go
- object.go
- platform.go
- query.go
- secret.go
- secret_scrub.go
- service.go
- services.go
- socket.go
- terminal.go
- typedef.go
- util.go
- void.go