Documentation
¶
Index ¶
- Constants
- Variables
- func AuthorizeCreateRepository(ctx context.Context, provider *githubauth4datatug.Provider, firebaseUID string, ...) (facade4datatug.GitHubCreateRepository, error)
- func AuthorizeCreateRepositoryWithScopes(ctx context.Context, provider *githubauth4datatug.Provider, firebaseUID string, ...) (facade4datatug.GitHubCreateRepository, error)
- func AuthorizeEnvironmentReadRepository(ctx context.Context, provider *githubauth4datatug.Provider, actor string, ...) (facade4datatug.GitHubEnvironmentRepository, error)
- func AuthorizeEnvironmentRepository(ctx context.Context, provider *githubauth4datatug.Provider, actor string, ...) (facade4datatug.GitHubEnvironmentRepository, error)
- func AuthorizeProjectStatusRepository(ctx context.Context, provider *githubauth4datatug.Provider, firebaseUID string, ...) (facade4datatug.GitHubCreateRepository, error)
- func AuthorizeQueryRepository(ctx context.Context, provider *githubauth4datatug.Provider, firebaseUID string, ...) (facade4datatug.GitHubQueryRepository, error)
- func ClonePublicDemo(ctx context.Context, commit, tree string) (map[string][]byte, error)
- func PublicEnvironmentState(ctx context.Context, scope dto.EnvironmentScope, owner, repo, folder string) (*dto.EnvironmentState, error)
- func ValidateQuickSearchAsset(kind, id string, body []byte) error
- type ConnectionCatalog
- type EnvironmentPresentation
- type ProjectSnapshot
- func OpenProjectSnapshot(ctx context.Context, client scopedReadClient, folder, branch string) (*ProjectSnapshot, error)
- func OpenProjectSnapshotAtHead(ctx context.Context, client scopedReadClient, folder, branch, head string) (*ProjectSnapshot, error)
- func OpenPublicProjectSnapshot(ctx context.Context, scope dto.EnvironmentScope, owner, repo, folder string) (*ProjectSnapshot, dto.EnvironmentScope, error)
- func (s *ProjectSnapshot) AllQueries(ctx context.Context) (*QueryFolder, error)
- func (s *ProjectSnapshot) Board(ctx context.Context, id string) (*datatug.Board, error)
- func (s *ProjectSnapshot) Boards(ctx context.Context) ([]datatug.ProjBoardBrief, error)
- func (s *ProjectSnapshot) Card(ctx context.Context, id string) (*datatug.Card, error)
- func (s *ProjectSnapshot) Cards(ctx context.Context) ([]datatug.CardBrief, error)
- func (s *ProjectSnapshot) CloneFiles(ctx context.Context, tree string) (map[string][]byte, error)
- func (s *ProjectSnapshot) ConnectionCatalog(ctx context.Context) (*ConnectionCatalog, error)
- func (s *ProjectSnapshot) Entities(ctx context.Context) ([]datatug.ProjEntityBrief, error)
- func (s *ProjectSnapshot) Entity(ctx context.Context, id string) (json.RawMessage, error)
- func (s *ProjectSnapshot) EnvironmentState(ctx context.Context, actor string, scope dto.EnvironmentScope, write bool) (*dto.EnvironmentState, error)
- func (s *ProjectSnapshot) Environments(ctx context.Context) (datatug.Environments, error)
- func (s *ProjectSnapshot) MeaningDocument(ctx context.Context) (datatug.ProjectMeaningsDocument, error)
- func (s *ProjectSnapshot) PrivateCloneFiles(ctx context.Context, tree string) (map[string][]byte, error)
- func (s *ProjectSnapshot) ProjectMeanings(ctx context.Context, project string, writable bool) (datatug.ProjectMeaningsDocument, datatug.ProjectMeaningsCatalog, 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)
- func (s *ProjectSnapshot) SafeEnvironments(ctx context.Context) ([]SafeEnvironment, error)
- func (s *ProjectSnapshot) SearchMetadata(ctx context.Context) (qs.MetadataSnapshot, error)
- type QueryFileChange
- type QueryFolder
- type QueryMutationPreview
- type QueryReadResult
- type SafeEnvironment
- type SkippedConnectionFile
Constants ¶
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 ¶
var ErrCloneSourceTooLarge = errors.New("GitHub source project exceeds 32 files; private archive cloning is required")
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 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 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
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 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 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) Boards ¶ added in v0.59.1
func (s *ProjectSnapshot) Boards(ctx context.Context) ([]datatug.ProjBoardBrief, error)
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
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 (s *ProjectSnapshot) Entities(ctx context.Context) ([]datatug.ProjEntityBrief, error)
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 (s *ProjectSnapshot) MeaningDocument(ctx context.Context) (datatug.ProjectMeaningsDocument, error)
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
func (s *ProjectSnapshot) ProjectMeanings(ctx context.Context, project string, writable bool) (datatug.ProjectMeaningsDocument, datatug.ProjectMeaningsCatalog, error)
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 (*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.
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.
type QueryReadResult ¶
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
SkippedConnectionFile names a declaration file left out of the catalog.
Source Files
¶
- clone_meaning_uses.go
- environment_repository.go
- project_assets.go
- project_clone.go
- project_clone_template.go
- project_connections.go
- project_create_repository.go
- project_environments.go
- project_meanings.go
- project_setup_pr.go
- project_snapshot.go
- public_environment_state.go
- public_project_clone.go
- query_codec.go
- query_read.go
- query_repository.go
- quick_search_metadata.go
- quick_search_prefetch.go