api

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModePlan  = "plan"
	ModeApply = "apply"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApproveRequest

type ApproveRequest struct {
	hmac.Signature        // ← EMBEDDING = sem duplicação de Timestamp/SignatureRequest
	Repo           string `json:"repo"`
	PRNumber       int    `json:"pr_number,omitempty"`
	HeadSHA        string `json:"head_sha,omitempty"`
}

type ApproveResponse

type ApproveResponse struct {
	JobID    string `json:"job_id,omitempty"`
	JobToken string `json:"job_token,omitempty"`
}

type ClosePlanRequest

type ClosePlanRequest struct {
	hmac.Signature
	Repo     string `json:"repo"`
	PRNumber int    `json:"pr_number"`
	HeadSHA  string `json:"head_sha"`
}

type ClosePlanResponse

type ClosePlanResponse struct {
	DeploymentID string `json:"deployment_id"`
	Status       string `json:"status"`
	Message      string `json:"message"`
}

type CreateRepositoryRequest

type CreateRepositoryRequest struct {
	Provider   string `json:"provider"`   // azure, github, gitlab (obrigatório)
	Identifier string `json:"identifier"` // URI ou ID nativo do repositório (obrigatório)
}

CreateRepositoryRequest é o payload para registrar um novo repositório POST /admin/repositories

type CreateRepositoryResponse

type CreateRepositoryResponse struct {
	model.RepositoryMetadata        // embedding - todos os campos do metadata
	RepoSecret               string `json:"repo_secret,omitempty"` // K_r derivado (só no POST)
	PlanSecret               string `json:"plan_secret,omitempty"`
	ApplySecret              string `json:"apply_secret,omitempty"`
	Instruction              string `json:"instruction,omitempty"` // Instrução para o usuário
	CreatedNew               bool   `json:"created_new"`           // true se criou novo, false se já existia
}

CreateRepositoryResponse retorna os dados do repositório registrado

type CredentialsRequest

type CredentialsRequest struct {
	hmac.Signature // ← EMBEDDING = sem duplicação de Timestamp/SignatureRequest

	Mode            string   `json:"mode"`
	Repo            string   `json:"repo"`
	PRNumber        string   `json:"pr_number,omitempty"`
	HeadSHA         string   `json:"head_sha,omitempty"`
	SourceBranchSHA string   `json:"source_branch_sha,omitempty"`
	SourceBranch    string   `json:"source_branch,omitempty"`
	TargetBranch    string   `json:"target_branch,omitempty"`
	Stacks          []string `json:"stacks,omitempty"`
	JobID           string   `json:"job_id,omitempty"`
	JobToken        string   `json:"job_token,omitempty"`
}

CredentialsRequest usa composition com SecureRequest Campos Timestamp e SignatureRequest vêm de SecureRequest (promoted fields)

type CredentialsResponse

type CredentialsResponse struct {
	AccessToken string    `json:"access_token"`
	ExpiresAt   time.Time `json:"expires_at"`
	Project     string    `json:"project"`
}

type RegisterPlanRequest

type RegisterPlanRequest struct {
	hmac.Signature // ← EMBEDDING = sem duplicação de Timestamp/SignatureRequest

	Repo            string   `json:"repo"`
	PRNumber        int      `json:"pr_number"`
	SourceBranch    string   `json:"source_branch"`
	TargetBranch    string   `json:"target_branch"`
	HeadSHA         string   `json:"head_sha"`
	SourceBranchSHA string   `json:"source_branch_sha,omitempty"` // SHA do tip da branch de origem (não o merge commit)
	PlanOutput      string   `json:"plan_output"`
	Stacks          []string `json:"stacks"`
	User            string   `json:"user"`
}

RegisterPlanRequest usa composition com SecureRequest Campos Timestamp e SignatureRequest vêm de SecureRequest (promoted fields)

func (*RegisterPlanRequest) Validate

func (r *RegisterPlanRequest) Validate() bool

type RegisterPlanResponse

type RegisterPlanResponse struct {
	DeploymentID string `json:"deployment_id"`
	Status       string `json:"status"`
	PlanVersion  int    `json:"plan_version"`
	Message      string `json:"message"`
}

type RegisterRepoRequest

type RegisterRepoRequest struct {
	Name     string `json:"name"` // Ex: "minha-org/infra-repo" ou URI
	Provider string `json:"provider,omitempty"`
}

RegisterRepoRequest é o formato antigo (deprecated) Mantido apenas para referência - será removido

type RegisterRepoResponse

type RegisterRepoResponse struct {
	RepoID      string `json:"repo_id"`     // UUID armazenado
	RepoSecret  string `json:"repo_secret"` // K_r (Chave derivada)
	Instruction string `json:"instruction"`
}

RegisterRepoResponse é o formato antigo (deprecated)

Jump to

Keyboard shortcuts

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