first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 21:52:23 +03:00
commit 880f412e2c
2662 changed files with 866266 additions and 0 deletions

34
core/schemas/async.go Normal file
View File

@@ -0,0 +1,34 @@
package schemas
import "time"
// AsyncJobStatus represents the status of an async job
type AsyncJobStatus string
const (
AsyncJobStatusPending AsyncJobStatus = "pending"
AsyncJobStatusProcessing AsyncJobStatus = "processing"
AsyncJobStatusCompleted AsyncJobStatus = "completed"
AsyncJobStatusFailed AsyncJobStatus = "failed"
)
const (
// AsyncHeaderResultTTL is the header containing the result TTL for async job retrieval.
AsyncHeaderResultTTL = "x-bf-async-job-result-ttl"
// AsyncHeaderCreate is the header that triggers async job creation on integration routes.
AsyncHeaderCreate = "x-bf-async"
// AsyncHeaderGetID is the header containing the job ID for async job retrieval on integration routes.
AsyncHeaderGetID = "x-bf-async-id"
)
// AsyncJobResponse is the JSON response returned when creating or polling an async job
type AsyncJobResponse struct {
ID string `json:"id"`
Status AsyncJobStatus `json:"status"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
StatusCode int `json:"status_code,omitempty"`
Result interface{} `json:"result,omitempty"`
Error *BifrostError `json:"error,omitempty"`
}