api4datatug

package
v0.11.1 Latest Latest
Warning

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

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

Documentation

Overview

Package api4datatug is the DataTug module's HTTP API layer. It translates HTTP into domain commands and back; the business logic lives in facade4datatug and the storage access in dal-go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHttpRoutes

func RegisterHttpRoutes(handle extension.HTTPHandleFunc, ids facade4datatug.IDGenerator)

RegisterHttpRoutes registers the DataTug module's HTTP routes.

ids is the host's adapter for the domain's IDGenerator port; the host supplies it at composition time (sneat-go/pkg/modules/datatug).

Route paths are literal: the host mounts them verbatim, with no module-id or /v0/ prefix added. These are the paths the datatug-apps client already calls.

func RegisterHttpRoutesWithOptions added in v0.10.0

func RegisterHttpRoutesWithOptions(handle extension.HTTPHandleFunc, ids facade4datatug.IDGenerator, options RouteOptions)

RegisterHttpRoutesWithOptions mounts the shared command as well as legacy routes. An unbound shared service returns 503 without authentication/storage effects. Binding this route requires independently reviewed host composition.

func RegisterHttpRoutesWithPlan added in v0.4.0

func RegisterHttpRoutesWithPlan(handle extension.HTTPHandleFunc, ids facade4datatug.IDGenerator, plan PlanRouteOptions)

RegisterHttpRoutesWithPlan adds the personal plan route with host-injected verification and reads. An unbound route fails closed with 503.

Types

type CreateProjectRequest

type CreateProjectRequest struct {
	StoreID string `json:"-"`
	Title   string `json:"title"`
}

CreateProjectRequest is the body of a create-project request. The store is taken from the `?store=` query parameter (the same shape the datatug CLI agent's create_project endpoint uses), so it is not part of the JSON body.

func (CreateProjectRequest) Validate

func (v CreateProjectRequest) Validate() error

Validate validates the request.

type CreateProjectResponse

type CreateProjectResponse struct {
	ID string `json:"id"`
}

CreateProjectResponse is the response of a successful create-project call.

type CreateSharedProjectRequest added in v0.10.0

type CreateSharedProjectRequest struct {
	SpaceID   string `json:"spaceID"`
	CommandID string `json:"commandID"`
	Title     string `json:"title"`
}

func (CreateSharedProjectRequest) Validate added in v0.10.0

func (r CreateSharedProjectRequest) Validate() error

type PlanRouteOptions added in v0.4.0

type PlanRouteOptions struct {
	Verifier VerifiedPlanCaller
	Service  facade4datatug.PersonalPlanService
}

type RegisterGithubProjectRequest added in v0.2.0

type RegisterGithubProjectRequest struct {
	Org    string `json:"org"`
	Repo   string `json:"repo"`
	Folder string `json:"folder"`
	Title  string `json:"title"`
}

RegisterGithubProjectRequest is the body of a register-github-project request: a project whose files the client has already committed to a GitHub repository, which the cloud only needs to record in the user's index.

func (RegisterGithubProjectRequest) Validate added in v0.2.0

func (v RegisterGithubProjectRequest) Validate() error

Validate validates the request.

type RegisterGithubProjectResponse added in v0.2.0

type RegisterGithubProjectResponse struct {
	ID string `json:"id"`
}

RegisterGithubProjectResponse is the response of a successful call.

type RouteOptions added in v0.10.0

type RouteOptions struct {
	Plan           PlanRouteOptions
	SharedProjects SharedProjectRouteOptions
}

RouteOptions preserve the existing plan binding and explicitly opt a host into the new shared route. Old registration APIs retain their exact routes.

type SharedProjectRouteOptions added in v0.10.0

type SharedProjectRouteOptions struct {
	Service *facade4datatug.SharedProjectService
}

SharedProjectRouteOptions are opt-in. No host currently configures these; absent options do not enable creation or infer a Business billing binding. This stage proves Space/role ownership only. A later host activation must separately enforce paid-Space/shared-project limits and ended-plan read-only policy; Core membership alone is not a commercial entitlement. Host activation also requires reviewed Firebase rules: today's broad Space member grants do not make the separate create-receipt subtree private.

type VerifiedPlanCaller added in v0.4.0

type VerifiedPlanCaller interface {
	VerifyPlanCaller(context.Context, *http.Request) (string, error)
}

VerifiedPlanCaller is implemented by the host's credential verifier. It must check token signature, audience, scope and active grant as applicable; this route never regards the Authorization header itself as proof.

Jump to

Keyboard shortcuts

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