Documentation
¶
Overview ¶
Package fetchprotocol is the internal contract between diffx-server and diffx-fetcher. The server owns GitHub credentials and identity; the fetcher leases one pull request at a time, mirrors it and returns an owner-free snapshot. It never claims an account or pull request metadata.
Index ¶
Constants ¶
const ( LeasePath = "/internal/v1/fetch-jobs/lease" ResultPath = "/internal/v1/fetch-jobs/result" )
const MaxResultBytes = ingestion.MaxRequestBytes + 1<<20
MaxResultBytes bounds a result: one snapshot plus envelope.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the fetcher's view of the server's internal listener.
type Job ¶
type Job struct {
ID string `json:"id"`
LeaseToken string `json:"leaseToken"`
LeaseExpiresAt int64 `json:"leaseExpiresAt"`
Repository Repository `json:"repository"`
Number int `json:"number"`
HeadSHA string `json:"headSha"`
BaseRef string `json:"baseRef"`
BaseSHA string `json:"baseSha"`
Token string `json:"token"`
TokenExpiresAt int64 `json:"tokenExpiresAt"`
}
Job leases one pull request head. Token is a short-lived installation token limited to Repository with contents:read; it is valid only for fetching.
type Repository ¶
type Result ¶
type Result struct {
ID string `json:"id"`
LeaseToken string `json:"leaseToken"`
Request *ingestion.Request `json:"request,omitempty"`
Error string `json:"error,omitempty"`
}
Result completes a lease with a snapshot, or fails it with a detail for retry.
type StatusError ¶
StatusError reports a non-success response; 409 means the lease was lost.
func (*StatusError) Error ¶
func (err *StatusError) Error() string