Documentation
¶
Index ¶
- Variables
- func AuthorizeCreateRepository(ctx context.Context, provider *githubauth4datatug.Provider, firebaseUID string, ...) (facade4datatug.GitHubCreateRepository, error)
- func AuthorizeQueryRepository(ctx context.Context, provider *githubauth4datatug.Provider, firebaseUID string, ...) (facade4datatug.GitHubQueryRepository, error)
- type ProjectSnapshot
- func (s *ProjectSnapshot) AllQueries(ctx context.Context) (*QueryFolder, error)
- func (s *ProjectSnapshot) Environments(ctx context.Context) (datatug.Environments, error)
- func (s *ProjectSnapshot) ProjectSummary(ctx context.Context) (json.RawMessage, error)
- func (s *ProjectSnapshot) QueryFiles(ctx context.Context, folderPath, id string) (map[string][]byte, string, error)
- func (s *ProjectSnapshot) ReadFile(ctx context.Context, relative string) ([]byte, error)
- func (s *ProjectSnapshot) ReadQueryRevision(ctx context.Context, folderPath, id string) (out *QueryReadResult, resultErr error)
- type QueryFileChange
- type QueryFolder
- type QueryMutationPreview
- type QueryReadResult
Constants ¶
This section is empty.
Variables ¶
var ErrGitHubCreateProof = errors.New("GitHub project commit could not be proven")
var ErrGitHubQueryCommitProof = errors.New("GitHub query commit could not be proven")
var ErrInvalidProjectSnapshot = errors.New("invalid GitHub project snapshot")
var ErrInvalidQuerySnapshot = errors.New("invalid query snapshot")
var ErrProjectFileMissing = errors.New("GitHub project file missing")
var ErrUnsupportedExistingQuery = errors.New("existing query contains unsupported metadata")
Functions ¶
func AuthorizeCreateRepository ¶
func AuthorizeCreateRepository(ctx context.Context, provider *githubauth4datatug.Provider, firebaseUID string, repositoryID int64, owner, name string) (facade4datatug.GitHubCreateRepository, error)
AuthorizeCreateRepository is the production host composition seam. The dedicated DataTug App provider rechecks the current Firebase UID, GitHub actor, installation, repository identity and effective user write grant.
func AuthorizeQueryRepository ¶
func AuthorizeQueryRepository(ctx context.Context, provider *githubauth4datatug.Provider, firebaseUID string, repositoryID int64, owner, name string) (facade4datatug.GitHubQueryRepository, error)
Types ¶
type ProjectSnapshot ¶
type ProjectSnapshot struct {
Folder string
Branch string
Head string
// contains filtered or unexported fields
}
ProjectSnapshot pins every file lookup to one immutable commit. It never reads a second branch ref while constructing a response.
func OpenProjectSnapshot ¶
func OpenProjectSnapshot(ctx context.Context, client scopedReadClient, folder, branch string) (*ProjectSnapshot, error)
func OpenProjectSnapshotAtHead ¶
func OpenProjectSnapshotAtHead(ctx context.Context, client scopedReadClient, folder, branch, head string) (*ProjectSnapshot, error)
OpenProjectSnapshotAtHead is used to reconstruct an intended query mutation after a lost provider response. It never substitutes the branch's new head for the immutable expected head supplied by the original operation.
func (*ProjectSnapshot) AllQueries ¶
func (s *ProjectSnapshot) AllQueries(ctx context.Context) (*QueryFolder, error)
func (*ProjectSnapshot) Environments ¶ added in v0.28.0
func (s *ProjectSnapshot) Environments(ctx context.Context) (datatug.Environments, error)
Environments reads only declared environment metadata from this pinned project snapshot. Connection secrets and source rows never leave the reader.
func (*ProjectSnapshot) ProjectSummary ¶
func (s *ProjectSnapshot) ProjectSummary(ctx context.Context) (json.RawMessage, error)
ProjectSummary returns the existing manifest wire object without dropping future or legacy metadata. The immutable registered locator supplies access control; this JSON is only display data.
func (*ProjectSnapshot) QueryFiles ¶
func (*ProjectSnapshot) ReadQueryRevision ¶
func (s *ProjectSnapshot) ReadQueryRevision(ctx context.Context, folderPath, id string) (out *QueryReadResult, resultErr error)
ReadQueryRevision retains unknown and legacy metadata in the read response. Only a current narrow Core pair receives a writable Core revision. Rich definitions are readable but cannot be round-tripped through narrow saves.
type QueryFileChange ¶
type QueryFolder ¶
type QueryFolder struct {
ID string `json:"id"`
Folders []*QueryFolder `json:"folders,omitempty"`
Items []json.RawMessage `json:"items,omitempty"`
}
type QueryMutationPreview ¶
type QueryMutationPreview struct {
Changes []QueryFileChange
Response dto.SaveQueryResponse
// BodyChanged is false when the previous sidecar cannot be proved exactly;
// ambiguity never makes an otherwise valid save billable or changes its
// existing mutation eligibility.
BodyChanged bool
}
func PreviewQueryMutation ¶
func PreviewQueryMutation(ctx context.Context, request dto.SaveQueryRequest, snapshot map[string][]byte) (out *QueryMutationPreview, resultErr error)
PreviewQueryMutation runs the published Core revisioned query store in a fresh private scratch directory. The returned changes are the exact metadata/body files to send together in one Git commit at an expected head. All temp data is removed on every result, including conflicts and faults. The snapshot contains only the target query pair at one immutable commit.