api

package
v0.0.0-...-2cf6353 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package api provides the CLI/HTTP API interface for external automation This is how external systems interact with Kairo

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	Action  string          `json:"action"`
	Payload json.RawMessage `json:"payload"`
}

Request is the base request structure for all API calls

type Response

type Response struct {
	Success bool        `json:"success"`
	Data    interface{} `json:"data,omitempty"`
	Error   string      `json:"error,omitempty"`
}

Response is the base response structure

type TaskAPI

type TaskAPI struct {
	// contains filtered or unexported fields
}

TaskAPI defines the external API for task operations This is the contract for CLI/HTTP endpoints

func New

func New(svc service.TaskService) *TaskAPI

New creates a new task API

func (*TaskAPI) Execute

func (api *TaskAPI) Execute(ctx context.Context, req Request) Response

Execute processes an API request and returns a response

type TaskDTO

type TaskDTO struct {
	ID          string   `json:"id"`
	Title       string   `json:"title"`
	Description string   `json:"description,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	Priority    int      `json:"priority"`
	Status      string   `json:"status"`
	Deadline    *string  `json:"deadline,omitempty"`
	CreatedAt   string   `json:"created_at"`
	UpdatedAt   string   `json:"updated_at"`
}

TaskDTO is the data transfer object for tasks (matches Lua and JSON schema)

Jump to

Keyboard shortcuts

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