githubstore4datatug

package
v0.61.3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 33 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	SkipInvalidJSON     = "invalid_json"
	SkipInvalidCatalog  = "invalid_catalog"
	SkipFileTooLarge    = "file_too_large"
	SkipCatalogTooLarge = "catalog_too_large"
	SkipTooManyFiles    = "too_many_files"
)

Typed per-file reasons a declaration file did not contribute connections.

Variables

View Source
var ErrCloneSourceTooLarge = errors.New("GitHub source project exceeds 32 files; private archive cloning is required")
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 AuthorizeCreateRepositoryWithScopes added in v0.59.1

func AuthorizeCreateRepositoryWithScopes(ctx context.Context, provider *githubauth4datatug.Provider, firebaseUID string, repositoryID int64, owner, name string, scopes []string) (facade4datatug.GitHubCreateRepository, error)

func AuthorizeEnvironmentReadRepository added in v0.59.1

func AuthorizeEnvironmentReadRepository(ctx context.Context, provider *githubauth4datatug.Provider, actor string, id int64, owner, name string) (facade4datatug.GitHubEnvironmentRepository, error)

func AuthorizeEnvironmentRepository added in v0.59.1

func AuthorizeEnvironmentRepository(ctx context.Context, provider *githubauth4datatug.Provider, actor string, id int64, owner, name string) (facade4datatug.GitHubEnvironmentRepository, error)

func AuthorizeProjectStatusRepository added in v0.59.1

func AuthorizeProjectStatusRepository(ctx context.Context, provider *githubauth4datatug.Provider, firebaseUID string, repositoryID int64, owner, name string) (facade4datatug.GitHubCreateRepository, error)

func AuthorizeQueryRepository

func AuthorizeQueryRepository(ctx context.Context, provider *githubauth4datatug.Provider, firebaseUID string, repositoryID int64, owner, name string) (facade4datatug.GitHubQueryRepository, error)

func ClonePublicDemo added in v0.59.1

func ClonePublicDemo(ctx context.Context, commit, tree string) (map[string][]byte, error)

func ClonePublicDemoForCloud added in v0.61.1

func ClonePublicDemoForCloud(ctx context.Context, commit, tree string) (map[string][]byte, error)

ClonePublicDemoForCloud verifies current canonical repository/mainline authority before exporting a pinned public demo. Unlike GitHub setup copies, Cloud's bounded snapshot can retain training fixtures above the generic limit. The selected commit may be an older mainline ancestor; provenance stays pinned to that actual commit and the version declared in its immutable manifest.

func PublicEnvironmentState added in v0.59.1

func PublicEnvironmentState(ctx context.Context, scope dto.EnvironmentScope, owner, repo, folder string) (*dto.EnvironmentState, error)

PublicEnvironmentState uses only unauthenticated GitHub REST requests. The repository's explicit public visibility is verified before reading a tree.

func ValidateQuickSearchAsset added in v0.59.1

func ValidateQuickSearchAsset(kind, id string, body []byte) error

ValidateQuickSearchAsset uses the same current source decoder as the serving GitHub asset reader, without returning SQL/configuration to the search engine.

Types

type ConnectionCatalog added in v0.59.1

type ConnectionCatalog struct {
	Connections  []json.RawMessage
	SkippedFiles []SkippedConnectionFile
	Extra        map[string]json.RawMessage
}

ConnectionCatalog is the merge of every connections/*.json file. Its connections keep each declaration's own fields untouched, and the other top-level keys of the files that declare connections (format, source, comparisonFixtures, ...) are kept too, the first file in sorted order winning, so existing readers of the catalog keep working.

func (ConnectionCatalog) MarshalJSON added in v0.59.1

func (c ConnectionCatalog) MarshalJSON() ([]byte, error)

MarshalJSON writes the extra top-level keys, then connections and, only when files were skipped, skippedFiles; neither can be overridden by a file.

type EnvironmentPresentation added in v0.59.1

type EnvironmentPresentation struct {
	Label string `json:"label,omitempty"`
	Icon  string `json:"icon,omitempty"`
	Tone  string `json:"tone,omitempty"`
}

type ProjectSnapshot

type ProjectSnapshot struct {
	// ArchivedItems is a DataTug visibility overlay supplied by the authenticated API.
	// Source reads and execution resolvers deliberately ignore it.
	ArchivedItems map[datatug.ProjectObjectRef]bool

	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 OpenPublicProjectSnapshot added in v0.60.0

func OpenPublicProjectSnapshot(ctx context.Context, scope dto.EnvironmentScope, owner, repo, folder string) (*ProjectSnapshot, dto.EnvironmentScope, error)

OpenPublicProjectSnapshot proves explicit public repository visibility before opening a pinned tree. It shares the existing unauthenticated bounded reader; it never reuses an actor credential or accepts a project-selected API origin.

func (*ProjectSnapshot) AllQueries

func (s *ProjectSnapshot) AllQueries(ctx context.Context) (*QueryFolder, error)

func (*ProjectSnapshot) Board added in v0.59.1

func (s *ProjectSnapshot) Board(ctx context.Context, id string) (*datatug.Board, error)

func (*ProjectSnapshot) Boards added in v0.59.1

func (*ProjectSnapshot) Card added in v0.59.1

func (s *ProjectSnapshot) Card(ctx context.Context, id string) (*datatug.Card, error)

Card reads one card by id.

func (*ProjectSnapshot) Cards added in v0.59.1

Cards lists the briefs of the project's cards. A card stored in both layouts is read from the folder form, which wins (spec: project-cards). A stray file whose name is no card id, or a card that does not validate, is left out of the list (and logged): one bad file must not hide the project's cards.

func (*ProjectSnapshot) CloneFiles added in v0.59.1

func (s *ProjectSnapshot) CloneFiles(ctx context.Context, tree string) (map[string][]byte, error)

CloneFiles exports only declarative project content from the pinned tree. Provider workflows, executables, credentials and arbitrary repository files never become part of the destination setup proof.

func (*ProjectSnapshot) ConnectionCatalog added in v0.59.1

func (s *ProjectSnapshot) ConnectionCatalog(ctx context.Context) (*ConnectionCatalog, error)

ConnectionCatalog merges the project's connections/*.json files the same way the browser repository reader does: files in sorted-name order, the first declaration of an id wins, declarations without an id follow the keyed ones, and a file that is not a usable catalog is skipped rather than fatal.

func (*ProjectSnapshot) Entities added in v0.59.1

func (*ProjectSnapshot) Entity added in v0.59.1

func (s *ProjectSnapshot) Entity(ctx context.Context, id string) (json.RawMessage, error)

func (*ProjectSnapshot) EnvironmentState added in v0.59.1

func (s *ProjectSnapshot) EnvironmentState(ctx context.Context, actor string, scope dto.EnvironmentScope, write bool) (*dto.EnvironmentState, 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) MeaningDocument added in v0.59.1

func (*ProjectSnapshot) PrivateCloneFiles added in v0.59.1

func (s *ProjectSnapshot) PrivateCloneFiles(ctx context.Context, tree string) (map[string][]byte, error)

PrivateCloneFiles bounds the per-blob provider reader to 32 source files. Large public demo projects use a single archive request instead.

func (*ProjectSnapshot) ProjectMeanings added in v0.59.1

ProjectMeanings uses one actor-authorized immutable repository snapshot for definitions, every nested query, dashboards and declared environment metadata.

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.

func (*ProjectSnapshot) SafeEnvironments added in v0.59.1

func (s *ProjectSnapshot) SafeEnvironments(ctx context.Context) ([]SafeEnvironment, error)

func (*ProjectSnapshot) SearchMetadata added in v0.59.1

func (s *ProjectSnapshot) SearchMetadata(ctx context.Context) (qs.MetadataSnapshot, error)

SearchMetadata projects only names, tags and typed navigation from a complete immutable tree.

func (*ProjectSnapshot) VisibilityTargets added in v0.61.1

func (s *ProjectSnapshot) VisibilityTargets(ctx context.Context) ([]datatug.ProjectObjectUsage, error)

VisibilityTargets describes project-owned definitions in this immutable source snapshot. Database/catalog resources merely referenced by a manifest are not manufactured into mutable project items. No execution history is read.

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"`
}

type SafeEnvironment added in v0.59.1

type SafeEnvironment struct {
	ID           string                   `json:"id"`
	Title        string                   `json:"title,omitempty"`
	Presentation *EnvironmentPresentation `json:"presentation,omitempty"`
}

type SkippedConnectionFile added in v0.59.1

type SkippedConnectionFile struct {
	File  string `json:"file"`
	Error string `json:"error"`
}

SkippedConnectionFile names a declaration file left out of the catalog.

Jump to

Keyboard shortcuts

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