{"modulePath":"github.com/chunkifydev/chunkify-go","version":"v1.0.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package shared\n\n## Types\n\n```go\ntype AssetOutputError struct {\n\t// Machine-readable processing error code.\n\tCode string `json:\"code\" api:\"required\"`\n\t// Description of the processing failure.\n\tMessage string `json:\"message\" api:\"required\"`\n\t// JSON contains metadata for fields, check presence with [respjson.Field.Valid].\n\tJSON struct {\n\t\tCode        respjson.Field\n\t\tMessage     respjson.Field\n\t\tExtraFields map[string]respjson.Field\n\t\t// contains filtered or unexported fields\n\t} `json:\"-\"`\n}\n```\nA customer-facing Asset output processing failure.\n\n```go\nfunc (r AssetOutputError) RawJSON() string\n```\nReturns the unmodified JSON received from the API\n\n```go\nfunc (r *AssetOutputError) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype ChunkifyError struct {\n\t// Additional error details or output\n\tDetail string `json:\"detail\" api:\"required\"`\n\t// Main error message\n\tMessage string `json:\"message\" api:\"required\"`\n\t// Type of error\n\t//\n\t// Any of \"setup\", \"ffmpeg\", \"source\", \"upload\", \"download\", \"ingest\", \"job\",\n\t// \"unexpected\", \"permission\", \"timeout\", \"cancelled\".\n\tType ChunkifyErrorType `json:\"type\" api:\"required\"`\n\t// JSON contains metadata for fields, check presence with [respjson.Field.Valid].\n\tJSON struct {\n\t\tDetail      respjson.Field\n\t\tMessage     respjson.Field\n\t\tType        respjson.Field\n\t\tExtraFields map[string]respjson.Field\n\t\t// contains filtered or unexported fields\n\t} `json:\"-\"`\n}\n```\n\n```go\nfunc (r ChunkifyError) RawJSON() string\n```\nReturns the unmodified JSON received from the API\n\n```go\nfunc (r *ChunkifyError) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype ChunkifyErrorType string\n```\nType of error\n\n```go\nconst (\n\tChunkifyErrorTypeSetup      ChunkifyErrorType = \"setup\"\n\tChunkifyErrorTypeFfmpeg     ChunkifyErrorType = \"ffmpeg\"\n\tChunkifyErrorTypeSource     ChunkifyErrorType = \"source\"\n\tChunkifyErrorTypeUpload     ChunkifyErrorType = \"upload\"\n\tChunkifyErrorTypeDownload   ChunkifyErrorType = \"download\"\n\tChunkifyErrorTypeIngest     ChunkifyErrorType = \"ingest\"\n\tChunkifyErrorTypeJob        ChunkifyErrorType = \"job\"\n\tChunkifyErrorTypeUnexpected ChunkifyErrorType = \"unexpected\"\n\tChunkifyErrorTypePermission ChunkifyErrorType = \"permission\"\n\tChunkifyErrorTypeTimeout    ChunkifyErrorType = \"timeout\"\n\tChunkifyErrorTypeCancelled  ChunkifyErrorType = \"cancelled\"\n)\n```\n\n```go\ntype CreatedVia string\n```\nCreatedVia specifies how the resource was created: api for API requests, dashboard for the Chunkify dashboard, mcp for MCP clients, and workflow for Workflow actions. Omitted when the creator is unknown.\n\n```go\nconst (\n\tCreatedViaAPI       CreatedVia = \"api\"\n\tCreatedViaDashboard CreatedVia = \"dashboard\"\n\tCreatedViaMcp       CreatedVia = \"mcp\"\n\tCreatedViaWorkflow  CreatedVia = \"workflow\"\n)\n```\n\n```go\ntype InstanceType string\n```\n\n```go\nconst (\n\tInstanceType4vCPU  InstanceType = \"4vCPU\"\n\tInstanceType8vCPU  InstanceType = \"8vCPU\"\n\tInstanceType16vCPU InstanceType = \"16vCPU\"\n)\n```\n\n```go\ntype Log struct {\n\t// Additional structured data attached to the log\n\tAttributes map[string]any `json:\"attributes\" api:\"required\"`\n\t// Log level\n\t//\n\t// Any of \"info\", \"error\", \"debug\".\n\tLevel LogLevel `json:\"level\" api:\"required\"`\n\t// The log message content\n\tMsg string `json:\"msg\" api:\"required\"`\n\t// Name of the service that generated the log\n\t//\n\t// Any of \"transcoder\", \"manager\".\n\tService LogService `json:\"service\" api:\"required\"`\n\t// Timestamp when the log was created\n\tTime time.Time `json:\"time\" api:\"required\" format:\"date-time\"`\n\t// Optional ID of the job this log is associated with\n\tJobID string `json:\"job_id\"`\n\t// JSON contains metadata for fields, check presence with [respjson.Field.Valid].\n\tJSON struct {\n\t\tAttributes  respjson.Field\n\t\tLevel       respjson.Field\n\t\tMsg         respjson.Field\n\t\tService     respjson.Field\n\t\tTime        respjson.Field\n\t\tJobID       respjson.Field\n\t\tExtraFields map[string]respjson.Field\n\t\t// contains filtered or unexported fields\n\t} `json:\"-\"`\n}\n```\n\n```go\nfunc (r Log) RawJSON() string\n```\nReturns the unmodified JSON received from the API\n\n```go\nfunc (r *Log) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype LogLevel string\n```\nLog level\n\n```go\nconst (\n\tLogLevelInfo  LogLevel = \"info\"\n\tLogLevelError LogLevel = \"error\"\n\tLogLevelDebug LogLevel = \"debug\"\n)\n```\n\n```go\ntype LogService string\n```\nName of the service that generated the log\n\n```go\nconst (\n\tLogServiceTranscoder LogService = \"transcoder\"\n\tLogServiceManager    LogService = \"manager\"\n)\n```\n\n```go\ntype TranscoderStatus struct {\n\t// Unique identifier of the transcoder\n\tID string `json:\"id\" api:\"required\"`\n\t// Billable time in seconds\n\tBillableTime int64 `json:\"billable_time\" api:\"required\"`\n\t// End time of the current chunk in seconds\n\tChunkEndTime float64 `json:\"chunk_end_time\" api:\"required\"`\n\t// Number of the chunk being processed\n\tChunkNumber int64 `json:\"chunk_number\" api:\"required\"`\n\t// Start time of the current chunk in seconds\n\tChunkStartTime float64 `json:\"chunk_start_time\" api:\"required\"`\n\t// CPU time used for transcoding in seconds\n\tCPUTime float64 `json:\"cpu_time\" api:\"required\"`\n\t// Timestamp when the status was created\n\tCreatedAt time.Time `json:\"created_at\" api:\"required\" format:\"date-time\"`\n\t// Current frames per second being processed\n\tFps float64 `json:\"fps\" api:\"required\"`\n\t// Current frame number being processed\n\tFrame int64 `json:\"frame\" api:\"required\"`\n\t// Unique identifier of the job\n\tJobID string `json:\"job_id\" api:\"required\"`\n\t// Current output time in seconds\n\tOutTime int64 `json:\"out_time\" api:\"required\"`\n\t// Progress percentage of the transcoding operation (0-100)\n\tProgress float64 `json:\"progress\" api:\"required\"`\n\t// Current processing speed multiplier\n\tSpeed float64 `json:\"speed\" api:\"required\"`\n\t// Current status of the transcoder (starting, transcoding, finished, failed)\n\t//\n\t// Any of \"starting\", \"pending\", \"transcoding\", \"completed\", \"failed\", \"cancelled\".\n\tStatus TranscoderStatusStatus `json:\"status\" api:\"required\"`\n\t// Unique identifier of the transcoder instance (generated by the transcoder)\n\tTranscoderInstanceID string `json:\"transcoder_instance_id\" api:\"required\"`\n\t// Timestamp when the status was last updated\n\tUpdatedAt time.Time `json:\"updated_at\" api:\"required\" format:\"date-time\"`\n\t// Error message if the transcoding failed\n\tError ChunkifyError `json:\"error\"`\n\t// JSON contains metadata for fields, check presence with [respjson.Field.Valid].\n\tJSON struct {\n\t\tID                   respjson.Field\n\t\tBillableTime         respjson.Field\n\t\tChunkEndTime         respjson.Field\n\t\tChunkNumber          respjson.Field\n\t\tChunkStartTime       respjson.Field\n\t\tCPUTime              respjson.Field\n\t\tCreatedAt            respjson.Field\n\t\tFps                  respjson.Field\n\t\tFrame                respjson.Field\n\t\tJobID                respjson.Field\n\t\tOutTime              respjson.Field\n\t\tProgress             respjson.Field\n\t\tSpeed                respjson.Field\n\t\tStatus               respjson.Field\n\t\tTranscoderInstanceID respjson.Field\n\t\tUpdatedAt            respjson.Field\n\t\tError                respjson.Field\n\t\tExtraFields          map[string]respjson.Field\n\t\t// contains filtered or unexported fields\n\t} `json:\"-\"`\n}\n```\n\n```go\nfunc (r TranscoderStatus) RawJSON() string\n```\nReturns the unmodified JSON received from the API\n\n```go\nfunc (r *TranscoderStatus) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype TranscoderStatusStatus string\n```\nCurrent status of the transcoder (starting, transcoding, finished, failed)\n\n```go\nconst (\n\tTranscoderStatusStatusStarting    TranscoderStatusStatus = \"starting\"\n\tTranscoderStatusStatusPending     TranscoderStatusStatus = \"pending\"\n\tTranscoderStatusStatusTranscoding TranscoderStatusStatus = \"transcoding\"\n\tTranscoderStatusStatusCompleted   TranscoderStatusStatus = \"completed\"\n\tTranscoderStatusStatusFailed      TranscoderStatusStatus = \"failed\"\n\tTranscoderStatusStatusCancelled   TranscoderStatusStatus = \"cancelled\"\n)\n```\n\n","path":"github.com/chunkifydev/chunkify-go/shared","name":"shared","synopsis":"","isRedistributable":true}
