githubstore4datatug

package
v0.27.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrGitHubCreateProof = errors.New("GitHub project commit could not be proven")
View Source
var ErrGitHubQueryCommitProof = errors.New("GitHub query commit could not be proven")
View Source
var ErrInvalidProjectSnapshot = errors.New("invalid GitHub project snapshot")
View Source
var ErrInvalidQuerySnapshot = errors.New("invalid query snapshot")
View Source
var ErrProjectFileMissing = errors.New("GitHub project file missing")
View Source
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) 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 (s *ProjectSnapshot) QueryFiles(ctx context.Context, folderPath, id string) (map[string][]byte, string, error)

func (*ProjectSnapshot) ReadFile

func (s *ProjectSnapshot) ReadFile(ctx context.Context, relative string) ([]byte, error)

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 QueryFileChange struct {
	Path    string
	Content []byte
	Delete  bool
}

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.

type QueryReadResult

type QueryReadResult struct {
	Query                 json.RawMessage `json:"query"`
	Revision              string          `json:"revision"`
	BranchHead            string          `json:"branchHead"`
	SaveSupported         bool            `json:"saveSupported"`
	UnsupportedSaveReason string          `json:"unsupportedSaveReason,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL