Documentation
¶
Index ¶
- Constants
- func Require(items ...Requirement) protocol.Requirement
- type Command
- func (c Command[In, Out]) ContractID() string
- func (c Command[In, Out]) Descriptor() protocol.CommandDescriptor
- func (c Command[In, Out]) Handle(runtime *Runtime, handler Handler[In, Out])
- func (c Command[In, Out]) Mode() protocol.CommandMode
- func (c Command[In, Out]) Name() string
- func (c Command[In, Out]) Revision() int
- type CommandOptions
- type Config
- type Context
- type Contract
- type Directory
- type DirectoryOptions
- type DirectorySetting
- type Handler
- type LocalDirectoryOptions
- type LocalDirectoryProvider
- func (d *LocalDirectoryProvider) Close() error
- func (d *LocalDirectoryProvider) Delete(relative string) error
- func (d *LocalDirectoryProvider) Export(ctx context.Context, request protocol.DirectoryExportRequest) (protocol.DirectoryExportResponse, error)
- func (d *LocalDirectoryProvider) Import(ctx context.Context, request protocol.DirectoryImportRequest) (protocol.DirectoryEntry, error)
- func (d *LocalDirectoryProvider) List(relative, cursor string, limit int) (protocol.DirectoryListResponse, error)
- func (d *LocalDirectoryProvider) Move(from, to string, overwrite bool) error
- func (d *LocalDirectoryProvider) Read(relative string, offset, length int64) (protocol.DirectoryReadResponse, error)
- func (d *LocalDirectoryProvider) Stat(relative string) (protocol.DirectoryEntry, error)
- func (d *LocalDirectoryProvider) Write(relative string, body []byte, overwrite bool) (protocol.DirectoryEntry, error)
- type Requirement
- type Runtime
- type Secret
- type Settings
- type SettingsDefinition
Constants ¶
const ( PlatformLinuxAMD64 = protocol.PlatformLinuxAMD64 PlatformLinuxARM64 = protocol.PlatformLinuxARM64 PlatformLinuxARMv7 = protocol.PlatformLinuxARMv7 PlatformDarwinAMD64 = protocol.PlatformDarwinAMD64 PlatformDarwinARM64 = protocol.PlatformDarwinARM64 PlatformWindowsAMD64 = protocol.PlatformWindowsAMD64 PlatformWindowsARM64 = protocol.PlatformWindowsARM64 )
Variables ¶
This section is empty.
Functions ¶
func Require ¶
func Require(items ...Requirement) protocol.Requirement
Types ¶
type Command ¶
type Command[In, Out any] struct { // contains filtered or unexported fields }
func DefineCommand ¶
func DefineCommand[In, Out any](contract Contract, name string, options CommandOptions) Command[In, Out]
func (Command[In, Out]) ContractID ¶
func (Command[In, Out]) Descriptor ¶
func (c Command[In, Out]) Descriptor() protocol.CommandDescriptor
func (Command[In, Out]) Mode ¶
func (c Command[In, Out]) Mode() protocol.CommandMode
type CommandOptions ¶
type Config ¶
type Config struct {
Kind string
Contract Contract
Name string
Description string
ArtifactVersion string
Targets []string
Settings SettingsDefinition
Validate func(context.Context) error
SelfTest func(context.Context) error
MaxConcurrency int
Input io.Reader
Output io.Writer
ErrorOutput io.Writer
}
Config declares a hosted connector child. Runtime transport and persistent installation state are supplied by airlock-host during initialization.
type Context ¶
type Context interface {
Deadline() (time.Time, bool)
Done() <-chan struct{}
Err() error
Value(key any) any
Progress(phase, message string, completed, total int64) error
JobID() string
IdempotencyID() string
}
Context is the command execution context. It exposes progress only for job commands and otherwise behaves as a standard context.Context.
type Contract ¶
type Contract struct {
// contains filtered or unexported fields
}
func DefineContract ¶
type Directory ¶
type Directory struct {
// contains filtered or unexported fields
}
func DefineDirectory ¶
func DefineDirectory(contract Contract, name string, options DirectoryOptions) Directory
func (Directory) ContractID ¶
func (Directory) Descriptor ¶
func (d Directory) Descriptor() protocol.DirectoryDescriptor
func (Directory) Handle ¶
func (d Directory) Handle(runtime *Runtime, provider *LocalDirectoryProvider)
type DirectoryOptions ¶
type DirectorySetting ¶
type DirectorySetting struct {
// contains filtered or unexported fields
}
DirectorySetting is an explicit binding to a string setting declared with connector kind directory.
type LocalDirectoryOptions ¶
type LocalDirectoryProvider ¶
type LocalDirectoryProvider struct {
// contains filtered or unexported fields
}
func BoundLocalDirectory ¶
func BoundLocalDirectory(setting DirectorySetting, options ...LocalDirectoryOptions) *LocalDirectoryProvider
BoundLocalDirectory opens a confined local filesystem root whose path is supplied by an explicitly selected directory setting at runtime.
func LocalDirectory ¶
func LocalDirectory(rootPath string, options ...LocalDirectoryOptions) *LocalDirectoryProvider
LocalDirectory opens a confined local filesystem root. The returned value must be registered with a Directory definition and is closed by Runtime.
func (*LocalDirectoryProvider) Close ¶
func (d *LocalDirectoryProvider) Close() error
func (*LocalDirectoryProvider) Delete ¶
func (d *LocalDirectoryProvider) Delete(relative string) error
func (*LocalDirectoryProvider) Export ¶
func (d *LocalDirectoryProvider) Export(ctx context.Context, request protocol.DirectoryExportRequest) (protocol.DirectoryExportResponse, error)
func (*LocalDirectoryProvider) Import ¶
func (d *LocalDirectoryProvider) Import(ctx context.Context, request protocol.DirectoryImportRequest) (protocol.DirectoryEntry, error)
func (*LocalDirectoryProvider) List ¶
func (d *LocalDirectoryProvider) List(relative, cursor string, limit int) (protocol.DirectoryListResponse, error)
func (*LocalDirectoryProvider) Move ¶
func (d *LocalDirectoryProvider) Move(from, to string, overwrite bool) error
func (*LocalDirectoryProvider) Read ¶
func (d *LocalDirectoryProvider) Read(relative string, offset, length int64) (protocol.DirectoryReadResponse, error)
func (*LocalDirectoryProvider) Stat ¶
func (d *LocalDirectoryProvider) Stat(relative string) (protocol.DirectoryEntry, error)
func (*LocalDirectoryProvider) Write ¶
func (d *LocalDirectoryProvider) Write(relative string, body []byte, overwrite bool) (protocol.DirectoryEntry, error)
type Requirement ¶
type Requirement interface {
// contains filtered or unexported methods
}
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
type Secret ¶
type Secret string
Secret marks a sensitive host-supplied setting. Its value is never included in connector manifests or logs by the SDK.
type Settings ¶
type Settings[T any] struct { // contains filtered or unexported fields }
Settings is a late-bound snapshot of connector settings. Get is available only while Runtime is executing a lifecycle command.
func DefineSettings ¶
DefineSettings declares the connector's settings schema. T must be a struct whose configurable fields use connector tags.
func (*Settings[T]) Directory ¶
func (s *Settings[T]) Directory(selectField func(*T) *string) DirectorySetting
Directory identifies one directory setting for BoundLocalDirectory.
type SettingsDefinition ¶
type SettingsDefinition interface {
// contains filtered or unexported methods
}
SettingsDefinition is a sealed connector settings declaration created by DefineSettings. The interface prevents raw mutable struct pointers from being supplied to Config.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package connectortest provides factory-first connector integration helpers.
|
Package connectortest provides factory-first connector integration helpers. |
|
Package protocol defines the JSON protocols exchanged by connector children, airlock-host, and Airlock.
|
Package protocol defines the JSON protocols exchanged by connector children, airlock-host, and Airlock. |