Documentation
¶
Index ¶
- Constants
- Variables
- func BindForgeOperation(provider forge.Provider, operation Operation) forge.Provider
- func ContainsSecret(data []byte, secret string) bool
- func GuardHTTP(client forge.HTTPClient, check func(context.Context) error) forge.HTTPClient
- func ProtectionHTTP(client forge.HTTPClient) forge.HTTPClient
- func WithForwarded(ctx context.Context) context.Context
- type Authenticate
- type Authorize
- type ChangeArgs
- type ChangesArgs
- type CheckLogArgs
- type ChecksArgs
- type Client
- func (c *Client) Close()
- func (c *Client) Complete(ctx context.Context, grant Grant, result Result) error
- func (c *Client) GoString() string
- func (c *Client) LogValue() slog.Value
- func (c *Client) Poll(ctx context.Context) (Grant, error)
- func (c *Client) RunOnce(ctx context.Context) error
- func (c *Client) String() string
- type ClientConfig
- type CompareArgs
- type Completion
- type Config
- type Connection
- type Connector
- func (c *Connector) Active(ctx context.Context, credential, grantID, capability string) error
- func (c *Connector) Close()
- func (c *Connector) Complete(ctx context.Context, credential, grantID, capability string, result Result) error
- func (c *Connector) Dispatch(ctx context.Context, target Target, operation Operation, authorize Authorize) (Result, error)
- func (c *Connector) GrantOwner(ctx context.Context, credential, grantID string) (string, error)
- func (c *Connector) Holds(grantID string) bool
- func (c *Connector) Notify(route string)
- func (c *Connector) Poll(ctx context.Context, credential string) (Grant, error)
- type Deliver
- type DeliveryArgs
- type Elsewhere
- type Executor
- type Failure
- type FileArgs
- type FilesArgs
- type FindChangeArgs
- type Grant
- type GrantSpec
- type InventoryArgs
- type Kind
- type Operation
- type PostgresRoutes
- func (r PostgresRoutes) Claim(ctx context.Context, org, route string, until time.Time) error
- func (r PostgresRoutes) Elsewhere(ctx context.Context, org, route string) (string, error)
- func (r PostgresRoutes) Listen(ctx context.Context, notify func(string))
- func (r PostgresRoutes) Release(org, route string)
- type ProtectionCredential
- type Ready
- type RefArgs
- type RepositoryArgs
- type Result
- type Routes
- type Target
Constants ¶
View Source
const DefaultTTL = 10 * time.Second
View Source
const MaxBatchFiles = 50
View Source
const MaxGrant = 1 << 20
View Source
const MaxMergeTTL = 2 * time.Minute
View Source
const MaxModelTTL = model.MaxTurnTimeout
View Source
const MaxResponse = 90 << 20
View Source
const MaxTTL = 30 * time.Second
Variables ¶
View Source
var ErrConflict = errors.New("private operation already active or consumed")
View Source
var ErrInvalid = errors.New("invalid private operation")
View Source
var ErrUncertain = errors.New("private operation outcome uncertain; reconcile before retry")
View Source
var ErrUnsupported = errors.New("private operation is not registered")
Functions ¶
func BindForgeOperation ¶
func ContainsSecret ¶
func GuardHTTP ¶
func GuardHTTP(client forge.HTTPClient, check func(context.Context) error) forge.HTTPClient
func ProtectionHTTP ¶
func ProtectionHTTP(client forge.HTTPClient) forge.HTTPClient
Types ¶
type ChangeArgs ¶
type ChangesArgs ¶
type CheckLogArgs ¶
type ChecksArgs ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(cfg ClientConfig) (*Client, error)
type ClientConfig ¶
type ClientConfig struct {
Endpoint string
Credential string `json:"-"`
Target Target
Development bool
CAPEM []byte
Client *http.Client `json:"-"`
Internal bool
Agents *agent.NativeManager
}
func (ClientConfig) GoString ¶
func (c ClientConfig) GoString() string
func (ClientConfig) LogValue ¶
func (c ClientConfig) LogValue() slog.Value
func (ClientConfig) String ¶
func (c ClientConfig) String() string
type CompareArgs ¶
type Completion ¶
type Connection ¶
type Connection struct {
Native *agent.NativeScope `json:"native,omitempty"`
Protection *ProtectionCredential `json:"protection,omitempty"`
CheckPublishers map[string]string `json:"check_publishers,omitempty"`
Kind string `json:"kind,omitempty"`
AuthKind string `json:"auth_kind,omitempty"`
AppID string `json:"app_id,omitempty"`
InstallationID string `json:"installation_id,omitempty"`
Model string `json:"model,omitempty"`
Profile string `json:"profile,omitempty"`
OrgID string `json:"org_id"`
ID string `json:"id"`
Version int64 `json:"version"`
CredentialVersion int64 `json:"credential_version"`
Provider string `json:"provider"`
Endpoint string `json:"endpoint"`
Route network.PrivateRoute `json:"route"`
CAPEM []byte `json:"ca_pem,omitempty"`
Secret string `json:"-"`
}
func (Connection) GoString ¶
func (c Connection) GoString() string
func (Connection) LogValue ¶
func (c Connection) LogValue() slog.Value
func (Connection) String ¶
func (c Connection) String() string
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
func (*Connector) GrantOwner ¶ added in v0.2.25
type DeliveryArgs ¶
type Executor ¶
type FindChangeArgs ¶
type Grant ¶
type Grant struct {
ID string `json:"id"`
RunnerVersion int64 `json:"runner_version"`
Target Target `json:"target"`
Operation Operation `json:"operation"`
AuthorityID string `json:"authority_id"`
Connection Connection `json:"connection"`
TimeoutMS int64 `json:"timeout_ms"`
ExpiresAt time.Time `json:"expires_at"`
ResultCapability string `json:"-"`
// contains filtered or unexported fields
}
func DecodeGrant ¶
func (Grant) MarshalWire ¶
type GrantSpec ¶
type InventoryArgs ¶
type Kind ¶
type Kind string
const ( ForgePipelineCancel Kind = "forge.pipeline_cancel" ForgePipelineInspect Kind = "forge.pipeline_inspect" ForgeDeliveryWorkflows Kind = "forge.delivery_workflows" ForgeDeliveryGates Kind = "forge.delivery_gates" ForgeDeliveryStatus Kind = "forge.delivery_status" ForgePipelineObserve Kind = "forge.pipeline_observe" ForgePipelineTrigger Kind = "forge.pipeline_trigger" ForgePipelineRecover Kind = "forge.pipeline_recover" ForgeMergeInspect Kind = "forge.merge_inspect" ForgeReadTrainGate Kind = "forge.read_train_gate" ForgeReleaseTrainGate Kind = "forge.release_train_gate" ForgeQueueInspect Kind = "forge.queue_inspect" ForgeMerge Kind = "forge.merge" ForgeMergeResult Kind = "forge.merge_result" ForgeQueueState Kind = "forge.queue_state" ForgeCancelQueue Kind = "forge.cancel_queue" ForgeCloseChange Kind = "forge.close_change" ForgeReadExecutionCheck Kind = "forge.read_execution_check" ForgeWriteExecutionCheck Kind = "forge.write_execution_check" ForgeCommitProof Kind = "forge.commit_proof" ForgeRefreshBranch Kind = "forge.refresh_branch" ForgeUpdateBranch Kind = "forge.update_branch" ForgeCreateChange Kind = "forge.create_change" ForgeFindChange Kind = "forge.find_change" ForgeProbe Kind = "forge.probe" ForgeInventory Kind = "forge.inventory" ForgeRepository Kind = "forge.repository" ForgeResolveRef Kind = "forge.resolve_ref" ForgeReadFile Kind = "forge.read_file" ForgeReadFiles Kind = "forge.read_files" ForgeCheckLog Kind = "forge.check_log" ForgeBehind Kind = "forge.behind" ForgeCommentChange Kind = "forge.comment_change" ForgeSourceManifest Kind = "forge.source_manifest" ForgeReadChange Kind = "forge.read_change" ForgeChecks Kind = "forge.checks" ForgeIssues Kind = "forge.issues" ForgeAdvisories Kind = "forge.advisories" ForgePermissionsURL Kind = "forge.permissions_url" ForgeApprovals Kind = "forge.approvals" ForgeReconcileChanges Kind = "forge.reconcile_changes" ModelProbe Kind = "model.probe" ModelList Kind = "model.list" ModelTurn Kind = "model.turn" AgentAction Kind = "agent.action" GiteaProbe = ForgeProbe GiteaInventory = ForgeInventory GiteaRepository = ForgeRepository GiteaResolveRef = ForgeResolveRef GiteaReadFile = ForgeReadFile GiteaReadChange = ForgeReadChange GiteaChecks = ForgeChecks GiteaApprovals = ForgeApprovals )
type Operation ¶
type Operation struct {
Agent *agent.NativeAction `json:"agent,omitempty"`
Delivery *DeliveryArgs `json:"delivery,omitempty"`
Pipeline *forge.PipelineRequest `json:"pipeline,omitempty"`
TrainGate *forge.TrainGateRequest `json:"train_gate,omitempty"`
ExecutionCheck *forge.ExecutionCheckRequest `json:"execution_check,omitempty"`
CancelQueue *forge.QueueCancelRequest `json:"cancel_queue,omitempty"`
Close *forge.CloseChangeRequest `json:"close,omitempty"`
Comment *forge.CommentChangeRequest `json:"comment,omitempty"`
Merge *forge.MergeRequest `json:"merge,omitempty"`
Commit *ChecksArgs `json:"commit,omitempty"`
Refresh *forge.RefreshBranchRequest `json:"refresh,omitempty"`
Branch *forge.UpdateBranchRequest `json:"branch,omitempty"`
Create *forge.CreateChangeRequest `json:"create,omitempty"`
Find *FindChangeArgs `json:"find,omitempty"`
Turn *model.Turn `json:"turn,omitempty"`
Source *ChecksArgs `json:"source,omitempty"`
Changes *ChangesArgs `json:"changes,omitempty"`
ID string `json:"id"`
Kind Kind `json:"kind"`
Inventory *InventoryArgs `json:"inventory,omitempty"`
Repository *RepositoryArgs `json:"repository,omitempty"`
Ref *RefArgs `json:"ref,omitempty"`
File *FileArgs `json:"file,omitempty"`
Files *FilesArgs `json:"files,omitempty"`
CheckLog *CheckLogArgs `json:"check_log,omitempty"`
Compare *CompareArgs `json:"compare,omitempty"`
Change *ChangeArgs `json:"change,omitempty"`
Checks *ChecksArgs `json:"checks,omitempty"`
}
func (Operation) MaximumTTL ¶
type PostgresRoutes ¶ added in v0.2.25
type PostgresRoutes struct {
// contains filtered or unexported fields
}
func NewPostgresRoutes ¶ added in v0.2.25
func NewPostgresRoutes(db *store.Store, self string) PostgresRoutes
func (PostgresRoutes) Listen ¶ added in v0.2.25
func (r PostgresRoutes) Listen(ctx context.Context, notify func(string))
func (PostgresRoutes) Release ¶ added in v0.2.25
func (r PostgresRoutes) Release(org, route string)
type ProtectionCredential ¶
type ProtectionCredential struct {
ID string `json:"id"`
Version int64 `json:"version"`
CredentialVersion int64 `json:"credential_version"`
Secret string `json:"-"`
}
func (ProtectionCredential) GoString ¶
func (p ProtectionCredential) GoString() string
func (ProtectionCredential) LogValue ¶
func (p ProtectionCredential) LogValue() slog.Value
func (ProtectionCredential) String ¶
func (p ProtectionCredential) String() string
type RepositoryArgs ¶
type Result ¶
type Result struct {
Native *agent.NativeState `json:"native,omitempty"`
Workflows []forge.Workflow `json:"workflows,omitempty"`
DeploymentGates *forge.DeploymentGates `json:"deployment_gates,omitempty"`
Deployment *forge.DeploymentStatus `json:"deployment,omitempty"`
TrainGate *forge.TrainGate `json:"train_gate,omitempty"`
ExecutionCheck *forge.ExecutionCheck `json:"execution_check,omitempty"`
Queue *forge.QueueState `json:"queue,omitempty"`
MergeEvidence *forge.MergeEvidence `json:"merge_evidence,omitempty"`
Merge *forge.MergeResult `json:"merge,omitempty"`
Commit *forge.CommitProof `json:"commit,omitempty"`
Turn *model.TurnResult `json:"turn,omitempty"`
Manifest *forge.SourceManifest `json:"manifest,omitempty"`
Changes *domain.Page[forge.Change] `json:"changes,omitempty"`
ModelCapabilities *model.Capabilities `json:"model_capabilities,omitempty"`
Models []model.Model `json:"models,omitempty"`
OperationID string `json:"operation_id"`
Failure *Failure `json:"failure,omitempty"`
Capabilities *forge.Capabilities `json:"capabilities,omitempty"`
Inventory *domain.Page[forge.Repository] `json:"inventory,omitempty"`
Repository *forge.Repository `json:"repository,omitempty"`
SHA string `json:"sha,omitempty"`
File *forge.File `json:"file,omitempty"`
Files []forge.File `json:"files,omitempty"`
Log string `json:"log,omitempty"`
Behind *int `json:"behind,omitempty"`
Change *forge.Change `json:"change,omitempty"`
Checks []forge.Check `json:"checks,omitempty"`
Approvals []forge.Approval `json:"approvals,omitempty"`
Issues []forge.Issue `json:"issues,omitempty"`
Advisories []forge.Advisory `json:"advisories,omitempty"`
Link string `json:"link,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.