client

package
v0.92.0 Latest Latest
Warning

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

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

Documentation

Overview

Package client provides a Go client SDK for the Flowbot server's web service API.

The client supports typed access to all major bot webservice endpoints including kanban, bookmark, user, search, dev, and server APIs.

Usage:

c := client.NewClient("http://localhost:6060", "your-access-token")

// List kanban tasks
tasks, err := c.Kanban.List(ctx, 1, kanboard.Active)

// Create a bookmark
bookmark, err := c.Bookmark.Create(ctx, "https://example.com")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns true if the error indicates a resource was not found.

func IsUnauthorized

func IsUnauthorized(err error) bool

IsUnauthorized returns true if the error indicates unauthorized access.

Types

type APIError

type APIError struct {
	StatusCode int
	RetCode    string
	Message    string
}

APIError represents an error returned by the Flowbot API.

func (*APIError) Error

func (e *APIError) Error() string

type AppHealthStatus

type AppHealthStatus struct {
	Name   string `json:"name"`
	Status string `json:"status"`
	Health string `json:"health"`
}

AppHealthStatus represents a homelab app's health.

type ArchiveResult

type ArchiveResult struct {
	Archived bool `json:"archived"`
}

ArchiveResult contains the result of archiving a bookmark.

type AttachTagsResult

type AttachTagsResult struct {
	Attached []string `json:"attached"`
}

AttachTagsResult contains the result of attaching tags to a bookmark.

type BookmarkClient

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

BookmarkClient provides access to the bookmark API.

func (*BookmarkClient) Archive

func (b *BookmarkClient) Archive(ctx context.Context, id string) (*ArchiveResult, error)

Archive archives (or unarchives) a bookmark.

func (*BookmarkClient) AttachTags

func (b *BookmarkClient) AttachTags(ctx context.Context, id string, tags []string) (*AttachTagsResult, error)

AttachTags attaches tags to a bookmark.

func (*BookmarkClient) CheckUrl

func (b *BookmarkClient) CheckUrl(ctx context.Context, url string) (*CheckUrlResult, error)

CheckUrl checks if a URL is already bookmarked.

func (*BookmarkClient) Create

func (b *BookmarkClient) Create(ctx context.Context, url string) (*karakeep.Bookmark, error)

Create creates a new bookmark from a URL.

func (*BookmarkClient) DetachTags

func (b *BookmarkClient) DetachTags(ctx context.Context, id string, tags []string) (*DetachTagsResult, error)

DetachTags detaches tags from a bookmark.

func (*BookmarkClient) Get

Get returns a single bookmark by ID.

func (*BookmarkClient) List

List returns all bookmarks with optional filtering.

func (*BookmarkClient) Search

Search searches bookmarks with the given query.

type BuildInfo

type BuildInfo struct {
	GoVersion   string   `json:"go_version"`
	MainModule  string   `json:"main_module"`
	MainVersion string   `json:"main_version,omitempty"`
	Settings    types.KV `json:"settings"`
}

BuildInfo contains build information.

type CapabilityHealth

type CapabilityHealth struct {
	Capability  string `json:"capability"`
	Backend     string `json:"backend"`
	App         string `json:"app"`
	Status      string `json:"status"`
	Description string `json:"description,omitempty"`
}

CapabilityHealth represents a single capability's health.

type CheckUrlResult

type CheckUrlResult struct {
	BookmarkId *string `json:"bookmarkId"`
}

CheckUrlResult contains the result of checking if a URL exists.

type Client

type Client struct {

	// Resource clients
	Kanban   *KanbanClient
	Bookmark *BookmarkClient
	Reader   *ReaderClient
	User     *UserClient
	Search   *SearchClient
	Dev      *DevClient
	Server   *ServerClient
	Hub      *HubClient
	Pipeline *PipelineClient
	Workflow *WorkflowClient
	Forge    *ForgeClient
	Github   *GithubClient
	Memo     *MemoClient
	// contains filtered or unexported fields
}

Client is the main client for the Flowbot API.

func NewClient

func NewClient(serverURL, token string) *Client

NewClient creates a new client with the given server URL and access token. The token is sent as the X-AccessToken header for authentication.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, path string, body, result any) error

Delete performs a DELETE request with the given body and unmarshals the response data into result.

func (*Client) Get

func (c *Client) Get(ctx context.Context, path string, result any) error

Get performs a GET request and unmarshals the response data into result.

func (*Client) Patch

func (c *Client) Patch(ctx context.Context, path string, body, result any) error

Patch performs a PATCH request with the given body and unmarshals the response data into result.

func (*Client) Post

func (c *Client) Post(ctx context.Context, path string, body, result any) error

Post performs a POST request with the given body and unmarshals the response data into result.

func (*Client) Put

func (c *Client) Put(ctx context.Context, path string, body, result any) error

Put performs a PUT request with the given body and unmarshals the response data into result.

func (*Client) RawRequest

func (c *Client) RawRequest() *resty.Request

RawRequest returns a resty request builder for custom requests. Use this when you need full control over the request.

func (*Client) SetDebug

func (c *Client) SetDebug(debug bool)

SetDebug enables or disables debug mode for the underlying HTTP client. Debug mode prints full HTTP request and response details to stderr. An OnError hook is also registered to print request info on connection failures.

func (*Client) SetTimeout

func (c *Client) SetTimeout(timeout time.Duration)

SetTimeout sets the request timeout for the client.

type CreateFeedRequest

type CreateFeedRequest struct {
	FeedURL    string `json:"feed_url"`
	CategoryID int64  `json:"category_id"`
}

CreateFeedRequest contains parameters for creating a feed.

type CreateFeedResult

type CreateFeedResult struct {
	ID int64 `json:"id"`
}

CreateFeedResult contains the result of creating a feed.

type CreateMemoRequest

type CreateMemoRequest struct {
	Content    string `json:"content"`
	Visibility string `json:"visibility,omitempty"`
}

CreateMemoRequest is the request body for creating a memo.

type DetachTagsResult

type DetachTagsResult struct {
	Detached []string `json:"detached"`
}

DetachTagsResult contains the result of detaching tags from a bookmark.

type DevClient

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

DevClient provides access to the dev API.

func (*DevClient) Example

func (d *DevClient) Example(ctx context.Context) (*ExampleData, error)

Example returns example data for testing purposes. This endpoint does not require authentication.

type ExampleData

type ExampleData struct {
	Title string `json:"title"`
	CPU   string `json:"cpu"`
	Mem   string `json:"mem"`
	Disk  string `json:"disk"`
}

ExampleData represents example data from the dev endpoint.

type FileContentQuery

type FileContentQuery struct {
	LineStart int
	LineCount int
}

FileContentQuery contains optional query parameters for retrieving file content.

type ForgeClient

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

ForgeClient provides access to the forge API.

func (*ForgeClient) GetCommitDiff

func (f *ForgeClient) GetCommitDiff(ctx context.Context, owner, repo, commitID string) (*ability.ForgeCommitDiff, error)

GetCommitDiff returns the diff for a specific commit.

func (*ForgeClient) GetFileContent

func (f *ForgeClient) GetFileContent(ctx context.Context, owner, repo, commitID, filePath string, query *FileContentQuery) (string, error)

GetFileContent returns the content of a file at a specific commit.

func (*ForgeClient) GetIssue

func (f *ForgeClient) GetIssue(ctx context.Context, owner, repo string, index int64) (*ability.ForgeIssue, error)

GetIssue returns a single issue by owner, repo, and issue index.

func (*ForgeClient) GetRepo

func (f *ForgeClient) GetRepo(ctx context.Context, owner, repo string) (*ability.ForgeRepo, error)

GetRepo returns a repository by owner and repo name.

func (*ForgeClient) GetUser

func (f *ForgeClient) GetUser(ctx context.Context) (*ability.ForgeUser, error)

GetUser returns the authenticated forge user.

func (*ForgeClient) ListIssues

func (f *ForgeClient) ListIssues(ctx context.Context, owner string, query *ListIssuesQuery) ([]*ability.ForgeIssue, error)

ListIssues returns issues for an owner with optional filtering.

type GC

type GC struct {
	NumGC        uint32 `json:"num_gc"`
	PauseTotalNs uint64 `json:"pause_total_ns"`
	LastGC       string `json:"last_gc"`
}

GC contains garbage collection statistics.

type GetFeedEntriesQuery

type GetFeedEntriesQuery struct {
	Status    string
	Limit     int
	Offset    int
	Order     string
	Direction string
	Starred   bool
}

GetFeedEntriesQuery contains query parameters for getting feed entries.

type GetSubtaskTimeSpentResult

type GetSubtaskTimeSpentResult struct {
	Result float64 `json:"result"`
}

GetSubtaskTimeSpentResult contains the result of getting time spent on a subtask.

type GithubClient

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

GithubClient provides access to the github API.

func (*GithubClient) GetCommitDiff

func (g *GithubClient) GetCommitDiff(ctx context.Context, owner, repo, commitID string) (*ability.ForgeCommitDiff, error)

GetCommitDiff returns the diff for a specific commit.

func (*GithubClient) GetFileContent

func (g *GithubClient) GetFileContent(ctx context.Context, owner, repo, commitID, filePath string, query *FileContentQuery) (string, error)

GetFileContent returns the content of a file at a specific commit.

func (*GithubClient) GetIssue

func (g *GithubClient) GetIssue(ctx context.Context, owner, repo string, number int64) (*ability.ForgeIssue, error)

GetIssue returns a single issue by owner, repo, and issue number.

func (*GithubClient) GetRepo

func (g *GithubClient) GetRepo(ctx context.Context, owner, repo string) (*ability.ForgeRepo, error)

GetRepo returns a repository by owner and repo name.

func (*GithubClient) GetUser

func (g *GithubClient) GetUser(ctx context.Context) (*ability.ForgeUser, error)

GetUser returns the authenticated github user.

func (*GithubClient) GetUserByLogin

func (g *GithubClient) GetUserByLogin(ctx context.Context, login string) (*ability.ForgeUser, error)

GetUserByLogin returns a github user by login name.

func (*GithubClient) ListIssues

func (g *GithubClient) ListIssues(ctx context.Context, owner string, query *ListIssuesQuery) ([]*ability.ForgeIssue, error)

ListIssues returns issues for an owner with optional filtering.

func (*GithubClient) ListNotifications

func (g *GithubClient) ListNotifications(ctx context.Context, query *ListNotificationsQuery) ([]*ability.Notification, error)

ListNotifications returns the authenticated user's notifications.

func (*GithubClient) ListReleases

func (g *GithubClient) ListReleases(ctx context.Context, owner, repo string, query *ListNotificationsQuery) ([]*ability.Release, error)

ListReleases returns releases for a repository.

type HasSubtaskTimerResult

type HasSubtaskTimerResult struct {
	Result bool `json:"result"`
}

HasSubtaskTimerResult contains the result of checking if a subtask timer is active.

type HubApp

type HubApp struct {
	Name   string         `json:"name"`
	Path   string         `json:"path"`
	Status string         `json:"status"`
	Health string         `json:"health"`
	Labels map[string]any `json:"labels,omitempty"`
}

HubApp represents a homelab app returned by the hub API.

type HubAppStatus

type HubAppStatus struct {
	Name   string   `json:"name"`
	Status string   `json:"status"`
	Logs   []string `json:"logs,omitempty"`
}

HubAppStatus represents the status of a homelab app.

type HubCapability

type HubCapability struct {
	Type        string `json:"type"`
	Backend     string `json:"backend"`
	App         string `json:"app"`
	Description string `json:"description,omitempty"`
	Healthy     bool   `json:"healthy"`
}

HubCapability represents a registered capability.

type HubClient

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

HubClient provides access to the hub management API.

func (*HubClient) GetApp

func (h *HubClient) GetApp(ctx context.Context, name string) (*HubApp, error)

GetApp returns a single app by name.

func (*HubClient) GetAppLogs

func (h *HubClient) GetAppLogs(ctx context.Context, name string, tail int) (*HubAppStatus, error)

GetAppLogs returns logs for an app.

func (*HubClient) GetAppStatus

func (h *HubClient) GetAppStatus(ctx context.Context, name string) (*HubAppStatus, error)

GetAppStatus returns the status of an app.

func (*HubClient) GetCapability

func (h *HubClient) GetCapability(ctx context.Context, capType string) (*HubCapability, error)

GetCapability returns a single capability by type.

func (*HubClient) GetHealth

func (h *HubClient) GetHealth(ctx context.Context) (*HubHealth, error)

GetHealth returns the overall hub health.

func (*HubClient) ListApps

func (h *HubClient) ListApps(ctx context.Context) ([]HubApp, error)

ListApps lists all registered homelab apps.

func (*HubClient) ListCapabilities

func (h *HubClient) ListCapabilities(ctx context.Context) ([]HubCapability, error)

ListCapabilities lists all registered capabilities.

func (*HubClient) RestartApp

func (h *HubClient) RestartApp(ctx context.Context, name string) (map[string]any, error)

RestartApp restarts a homelab app.

func (*HubClient) StartApp

func (h *HubClient) StartApp(ctx context.Context, name string) (map[string]any, error)

StartApp starts a homelab app.

func (*HubClient) StopApp

func (h *HubClient) StopApp(ctx context.Context, name string) (map[string]any, error)

StopApp stops a homelab app.

type HubHealth

type HubHealth struct {
	Status      string             `json:"status"`
	Timestamp   string             `json:"timestamp"`
	Details     []CapabilityHealth `json:"details,omitempty"`
	AppStatuses []AppHealthStatus  `json:"app_statuses,omitempty"`
}

HubHealth represents the overall hub health.

type KanbanClient

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

KanbanClient provides access to the kanban API.

func (*KanbanClient) Close

func (k *KanbanClient) Close(ctx context.Context, id int) (*KanbanUpdateResult, error)

Close closes (deletes) a kanban task.

func (*KanbanClient) Create

Create creates a new kanban task.

func (*KanbanClient) CreateSubtask

CreateSubtask creates a new subtask for a task.

func (*KanbanClient) CreateTag

CreateTag creates a new tag.

func (*KanbanClient) Get

func (k *KanbanClient) Get(ctx context.Context, id int) (*kanboard.Task, error)

Get returns a single kanban task by ID.

func (*KanbanClient) GetMetadata

func (k *KanbanClient) GetMetadata(ctx context.Context, taskID int) ([]kanboard.TaskMetadata, error)

GetMetadata returns all metadata for a task.

func (*KanbanClient) GetMetadataByName

func (k *KanbanClient) GetMetadataByName(ctx context.Context, taskID int, name string) (string, error)

GetMetadataByName returns a specific metadata value by name.

func (*KanbanClient) GetSubtask

func (k *KanbanClient) GetSubtask(ctx context.Context, taskID, subtaskID int) (*kanboard.Subtask, error)

GetSubtask returns a single subtask by ID.

func (*KanbanClient) GetSubtaskTimeSpent

func (k *KanbanClient) GetSubtaskTimeSpent(ctx context.Context, taskID, subtaskID, userID int) (*GetSubtaskTimeSpentResult, error)

GetSubtaskTimeSpent gets the time spent on a subtask for a user (in hours).

func (*KanbanClient) GetTaskTags

func (k *KanbanClient) GetTaskTags(ctx context.Context, taskID int) (map[string]string, error)

GetTaskTags returns all tags assigned to a task.

func (*KanbanClient) HasSubtaskTimer

func (k *KanbanClient) HasSubtaskTimer(ctx context.Context, taskID, subtaskID, userID int) (*HasSubtaskTimerResult, error)

HasSubtaskTimer checks if a timer is started for the given subtask and user.

func (*KanbanClient) List

func (k *KanbanClient) List(ctx context.Context, projectID int, status kanboard.StatusId) ([]kanboard.Task, error)

List returns all kanban tasks for the given project and status. Use kanboard.Active (1) for active tasks or kanboard.Inactive (0) for closed tasks.

func (*KanbanClient) ListAll

func (k *KanbanClient) ListAll(ctx context.Context, projectID int) ([]kanboard.Task, error)

ListAll returns all kanban tasks for the given project regardless of status.

func (*KanbanClient) ListColumns

func (k *KanbanClient) ListColumns(ctx context.Context, projectID int) ([]KanbanColumn, error)

ListColumns returns all columns for the given project.

func (*KanbanClient) ListSubtasks

func (k *KanbanClient) ListSubtasks(ctx context.Context, taskID int) ([]kanboard.Subtask, error)

ListSubtasks returns all subtasks for a task.

func (*KanbanClient) ListTags

func (k *KanbanClient) ListTags(ctx context.Context) ([]KanbanTag, error)

ListTags returns all tags.

func (*KanbanClient) ListTagsByProject

func (k *KanbanClient) ListTagsByProject(ctx context.Context, projectID int) ([]KanbanTag, error)

ListTagsByProject returns all tags for a given project.

func (*KanbanClient) Move

Move moves a kanban task to a different column and/or position.

func (*KanbanClient) RemoveMetadata

func (k *KanbanClient) RemoveMetadata(ctx context.Context, taskID int, name string) (*KanbanRemoveMetadataResult, error)

RemoveMetadata removes a metadata entry from a task.

func (*KanbanClient) RemoveSubtask

func (k *KanbanClient) RemoveSubtask(ctx context.Context, taskID, subtaskID int) (*KanbanRemoveSubtaskResult, error)

RemoveSubtask removes a subtask.

func (*KanbanClient) RemoveTag

func (k *KanbanClient) RemoveTag(ctx context.Context, id int) (*KanbanRemoveTagResult, error)

RemoveTag removes a tag.

func (*KanbanClient) SaveMetadata

func (k *KanbanClient) SaveMetadata(ctx context.Context, taskID int, values kanboard.TaskMetadata) (*KanbanSaveMetadataResult, error)

SaveMetadata saves metadata for a task.

func (*KanbanClient) Search

func (k *KanbanClient) Search(ctx context.Context, projectID int, query string) ([]kanboard.Task, error)

Search searches kanban tasks by query.

func (*KanbanClient) SetSubtaskEndTime

func (k *KanbanClient) SetSubtaskEndTime(ctx context.Context, taskID, subtaskID, userID int) (*SetSubtaskEndTimeResult, error)

SetSubtaskEndTime stops the subtask timer for a user.

func (*KanbanClient) SetSubtaskStartTime

func (k *KanbanClient) SetSubtaskStartTime(ctx context.Context, taskID, subtaskID, userID int) (*SetSubtaskStartTimeResult, error)

SetSubtaskStartTime starts the subtask timer for a user.

func (*KanbanClient) SetTaskTags

SetTaskTags sets tags for a task.

func (*KanbanClient) Update

Update updates an existing kanban task.

func (*KanbanClient) UpdateSubtask

func (k *KanbanClient) UpdateSubtask(ctx context.Context, taskID, subtaskID int, req KanbanUpdateSubtaskRequest) (*KanbanUpdateSubtaskResult, error)

UpdateSubtask updates an existing subtask.

func (*KanbanClient) UpdateTag

UpdateTag updates an existing tag.

type KanbanColumn

type KanbanColumn struct {
	ID    int    `json:"id"`
	Title string `json:"title"`
}

KanbanColumn represents a kanban column.

type KanbanCreateRequest

type KanbanCreateRequest struct {
	Title       string `json:"title"`
	Description string `json:"description,omitempty"`
	ProjectID   int    `json:"project_id,omitempty"`
	ColumnID    int    `json:"column_id,omitempty"`
}

KanbanCreateRequest contains the data needed to create a new kanban task.

type KanbanCreateResult

type KanbanCreateResult struct {
	ID int64 `json:"id"`
}

KanbanCreateResult contains the result of creating a kanban task.

type KanbanCreateSubtaskRequest

type KanbanCreateSubtaskRequest struct {
	Title         string `json:"title"`
	UserID        int    `json:"user_id,omitempty"`
	TimeEstimated int    `json:"time_estimated,omitempty"`
	TimeSpent     int    `json:"time_spent,omitempty"`
	Status        int    `json:"status,omitempty"`
}

KanbanCreateSubtaskRequest contains the data needed to create a new subtask.

type KanbanCreateSubtaskResult

type KanbanCreateSubtaskResult struct {
	ID int64 `json:"id"`
}

KanbanCreateSubtaskResult contains the result of creating a subtask.

type KanbanCreateTagRequest

type KanbanCreateTagRequest struct {
	ProjectID int    `json:"project_id"`
	Name      string `json:"name"`
	ColorID   string `json:"color_id,omitempty"`
}

KanbanCreateTagRequest contains the data needed to create a new tag.

type KanbanCreateTagResult

type KanbanCreateTagResult struct {
	ID int64 `json:"id"`
}

KanbanCreateTagResult contains the result of creating a tag.

type KanbanGetMetadataByNameResult

type KanbanGetMetadataByNameResult struct {
	Value string `json:"value"`
}

KanbanGetMetadataByNameResult contains the result of getting a single metadata value.

type KanbanGetMetadataResult

type KanbanGetMetadataResult struct {
	Metadata []kanboard.TaskMetadata `json:"metadata"`
}

KanbanGetMetadataResult contains the result of getting task metadata.

type KanbanGetTaskTagsResult

type KanbanGetTaskTagsResult struct {
	Tags map[string]string `json:"tags"`
}

KanbanGetTaskTagsResult contains the result of getting task tags.

type KanbanMoveRequest

type KanbanMoveRequest struct {
	ColumnID   int `json:"column_id"`
	Position   int `json:"position,omitempty"`
	SwimlaneID int `json:"swimlane_id,omitempty"`
	ProjectID  int `json:"project_id,omitempty"`
}

KanbanMoveRequest contains the parameters for moving a kanban task.

type KanbanMoveResult

type KanbanMoveResult struct {
	Success bool `json:"success"`
}

KanbanMoveResult contains the result of moving a kanban task.

type KanbanRemoveMetadataResult

type KanbanRemoveMetadataResult struct {
	Success bool `json:"success"`
}

KanbanRemoveMetadataResult contains the result of removing task metadata.

type KanbanRemoveSubtaskResult

type KanbanRemoveSubtaskResult struct {
	Success bool `json:"success"`
}

KanbanRemoveSubtaskResult contains the result of removing a subtask.

type KanbanRemoveTagResult

type KanbanRemoveTagResult struct {
	Success bool `json:"success"`
}

KanbanRemoveTagResult contains the result of removing a tag.

type KanbanSaveMetadataRequest

type KanbanSaveMetadataRequest struct {
	Values kanboard.TaskMetadata `json:"values"`
}

KanbanSaveMetadataRequest contains the request for saving task metadata.

type KanbanSaveMetadataResult

type KanbanSaveMetadataResult struct {
	Success bool `json:"success"`
}

KanbanSaveMetadataResult contains the result of saving task metadata.

type KanbanSearchResult

type KanbanSearchResult struct {
	Tasks []kanboard.Task `json:"tasks"`
}

KanbanSearchResult contains the result of searching kanban tasks.

type KanbanSetTaskTagsRequest

type KanbanSetTaskTagsRequest struct {
	ProjectID int      `json:"project_id"`
	Tags      []string `json:"tags"`
}

KanbanSetTaskTagsRequest contains the request for setting task tags.

type KanbanSetTaskTagsResult

type KanbanSetTaskTagsResult struct {
	Success bool `json:"success"`
}

KanbanSetTaskTagsResult contains the result of setting task tags.

type KanbanTag

type KanbanTag struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	ProjectID string `json:"project_id"`
}

KanbanTag represents a kanban tag.

type KanbanUpdateRequest

type KanbanUpdateRequest struct {
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
}

KanbanUpdateRequest contains the data for updating a kanban task.

type KanbanUpdateResult

type KanbanUpdateResult struct {
	Success bool `json:"success"`
}

KanbanUpdateResult contains the result of updating a kanban task.

type KanbanUpdateSubtaskRequest

type KanbanUpdateSubtaskRequest struct {
	Title         string `json:"title,omitempty"`
	UserID        int    `json:"user_id,omitempty"`
	TimeEstimated int    `json:"time_estimated,omitempty"`
	TimeSpent     int    `json:"time_spent,omitempty"`
	Status        int    `json:"status,omitempty"`
}

KanbanUpdateSubtaskRequest contains the data for updating a subtask.

type KanbanUpdateSubtaskResult

type KanbanUpdateSubtaskResult struct {
	Success bool `json:"success"`
}

KanbanUpdateSubtaskResult contains the result of updating a subtask.

type KanbanUpdateTagRequest

type KanbanUpdateTagRequest struct {
	Name    string `json:"name"`
	ColorID string `json:"color_id,omitempty"`
}

KanbanUpdateTagRequest contains the data for updating a tag.

type KanbanUpdateTagResult

type KanbanUpdateTagResult struct {
	Success bool `json:"success"`
}

KanbanUpdateTagResult contains the result of updating a tag.

type ListBookmarksQuery

type ListBookmarksQuery struct {
	Limit      int
	Cursor     string
	Archived   bool
	Favourited bool
}

ListBookmarksQuery contains query parameters for listing bookmarks.

type ListEntriesQuery

type ListEntriesQuery struct {
	Status     string
	Limit      int
	Offset     int
	Order      string
	Direction  string
	Starred    bool
	FeedID     int64
	CategoryID int64
}

ListEntriesQuery contains query parameters for listing entries.

type ListFeedsQuery

type ListFeedsQuery struct{}

ListFeedsQuery contains query parameters for listing feeds.

type ListIssuesQuery

type ListIssuesQuery struct {
	State  string
	Limit  int
	Cursor string
}

ListIssuesQuery contains query parameters for listing forge issues.

type ListMemosQuery

type ListMemosQuery struct {
	Limit  int
	Cursor string
}

ListMemosQuery contains query parameters for listing memos.

type ListNotificationsQuery

type ListNotificationsQuery struct {
	Limit  int
	Cursor string
}

ListNotificationsQuery contains query parameters for listing notifications.

type MemoClient

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

MemoClient provides access to the memo API.

func (*MemoClient) Create

func (m *MemoClient) Create(ctx context.Context, content, visibility string) (*ability.Memo, error)

Create creates a new memo.

func (*MemoClient) Delete

func (m *MemoClient) Delete(ctx context.Context, name string) error

Delete removes a memo by its resource name.

func (*MemoClient) Get

func (m *MemoClient) Get(ctx context.Context, name string) (*ability.Memo, error)

Get returns a single memo by its resource name (e.g., "memos/123").

func (*MemoClient) Health

func (m *MemoClient) Health(ctx context.Context) (bool, error)

Health checks whether the memo backend is reachable.

func (*MemoClient) List

func (m *MemoClient) List(ctx context.Context, query *ListMemosQuery) (*MemoListResult, error)

List returns a paginated list of memos.

func (*MemoClient) Update

func (m *MemoClient) Update(ctx context.Context, name string, req *UpdateMemoRequest) (*ability.Memo, error)

Update updates an existing memo.

type MemoHealthResult

type MemoHealthResult struct {
	Healthy bool `json:"data"`
}

MemoHealthResult holds the health check result extracted from InvokeResult.

type MemoItemResult

type MemoItemResult struct {
	Item ability.Memo `json:"data"`
}

MemoItemResult holds a single memo extracted from InvokeResult.

type MemoListResult

type MemoListResult struct {
	Items []*ability.Memo `json:"data"`
	Page  MemoPage        `json:"page"`
}

MemoListResult holds the paginated list response extracted from InvokeResult.

type MemoPage

type MemoPage struct {
	Limit      int    `json:"limit"`
	HasMore    bool   `json:"has_more"`
	NextCursor string `json:"next_cursor,omitzero"`
}

MemoPage holds pagination metadata.

type Memory

type Memory struct {
	RSSBytes  int64   `json:"rss_bytes"`
	VMSBytes  int64   `json:"vms_bytes"`
	SwapBytes int64   `json:"swap_bytes"`
	RSSMB     float64 `json:"rss_mb"`
	VMSMB     float64 `json:"vms_mb"`
}

Memory contains memory statistics.

type MetricsResult

type MetricsResult struct {
	BotTotalStats             int64 `json:"bot_total_stats,omitempty"`
	BookmarkTotalStats        int64 `json:"bookmark_total_stats,omitempty"`
	TorrentDownloadTotalStats int64 `json:"torrent_download_total_stats,omitempty"`
	GiteaIssueTotalStats      int64 `json:"gitea_issue_total_stats,omitempty"`
	ReaderUnreadTotalStats    int64 `json:"reader_unread_total_stats,omitempty"`
	KanbanTaskTotalStats      int64 `json:"kanban_task_total_stats,omitempty"`
	MonitorUpTotalStats       int64 `json:"monitor_up_total_stats,omitempty"`
	MonitorDownTotalStats     int64 `json:"monitor_down_total_stats,omitempty"`
	DockerContainerTotalStats int64 `json:"docker_container_total_stats,omitempty"`
}

MetricsResult contains system metrics data.

type PipelineClient

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

PipelineClient provides access to the pipeline API.

func (*PipelineClient) List

List returns configured pipelines from the hub.

func (*PipelineClient) Run

Run triggers a pipeline run by name.

type PipelineInfo

type PipelineInfo struct {
	Name        string              `json:"name"`
	Description string              `json:"description"`
	Enabled     bool                `json:"enabled"`
	Trigger     PipelineInfoTrigger `json:"trigger"`
	Steps       []PipelineInfoStep  `json:"steps"`
}

PipelineInfo is a pipeline metadata record.

type PipelineInfoStep

type PipelineInfoStep struct {
	Name       string         `json:"name"`
	Capability string         `json:"capability"`
	Operation  string         `json:"operation"`
	Params     map[string]any `json:"params"`
}

PipelineInfoStep holds a step definition in a pipeline list result.

type PipelineInfoTrigger

type PipelineInfoTrigger struct {
	Event string `json:"event"`
}

PipelineInfoTrigger holds the trigger definition for a pipeline.

type PipelineListResult

type PipelineListResult struct {
	Pipelines []PipelineInfo `json:"pipelines"`
}

PipelineListResult contains the list of pipelines.

type PipelineRunResult

type PipelineRunResult struct {
	Message string `json:"message"`
}

PipelineRunResult is the response from triggering a pipeline run.

type Process

type Process struct {
	Name          string  `json:"name"`
	PID           int     `json:"pid"`
	CreateTime    string  `json:"create_time"`
	UptimeSeconds float64 `json:"uptime_seconds"`
	Memory        Memory  `json:"memory"`
	CPUPercent    float64 `json:"cpu_percent"`
	NumThreads    int32   `json:"num_threads"`
}

Process contains process-level information.

type ReaderClient

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

ReaderClient provides access to the reader API.

func (*ReaderClient) CreateFeed

func (r *ReaderClient) CreateFeed(ctx context.Context, req *CreateFeedRequest) (*CreateFeedResult, error)

CreateFeed creates a new feed.

func (*ReaderClient) GetFeed

func (r *ReaderClient) GetFeed(ctx context.Context, id int64) (*rssClient.Feed, error)

GetFeed returns a single feed by ID.

func (*ReaderClient) GetFeedEntries

func (r *ReaderClient) GetFeedEntries(ctx context.Context, feedID int64, query *GetFeedEntriesQuery) (*rssClient.EntryResultSet, error)

GetFeedEntries returns entries for a specific feed.

func (*ReaderClient) ListEntries

func (r *ReaderClient) ListEntries(ctx context.Context, query *ListEntriesQuery) (*rssClient.EntryResultSet, error)

ListEntries returns entries with optional filtering.

func (*ReaderClient) ListFeeds

func (r *ReaderClient) ListFeeds(ctx context.Context) (rssClient.Feeds, error)

ListFeeds returns all feeds.

func (*ReaderClient) RefreshFeed

func (r *ReaderClient) RefreshFeed(ctx context.Context, id int64) (*RefreshFeedResult, error)

RefreshFeed triggers a refresh of a feed.

func (*ReaderClient) UpdateEntriesStatus

func (r *ReaderClient) UpdateEntriesStatus(ctx context.Context, req *UpdateEntriesRequest) (*UpdateEntriesResult, error)

UpdateEntriesStatus updates the status of multiple entries.

func (*ReaderClient) UpdateFeed

func (r *ReaderClient) UpdateFeed(ctx context.Context, id int64, req *UpdateFeedRequest) (*rssClient.Feed, error)

UpdateFeed updates an existing feed.

type RefreshFeedResult

type RefreshFeedResult struct {
	Success bool `json:"success"`
}

RefreshFeedResult contains the result of refreshing a feed.

type Runtime

type Runtime struct {
	GoVersion    string        `json:"go_version"`
	NumCPU       int           `json:"num_cpu"`
	NumGoroutine int           `json:"num_goroutine"`
	Memory       RuntimeMemory `json:"memory"`
	GC           GC            `json:"gc"`
}

Runtime contains Go runtime information.

type RuntimeMemory

type RuntimeMemory struct {
	AllocBytes      uint64  `json:"alloc_bytes"`
	TotalAllocBytes uint64  `json:"total_alloc_bytes"`
	SysBytes        uint64  `json:"sys_bytes"`
	HeapAllocBytes  uint64  `json:"heap_alloc_bytes"`
	HeapSysBytes    uint64  `json:"heap_sys_bytes"`
	AllocMB         float64 `json:"alloc_mb"`
	SysMB           float64 `json:"sys_mb"`
}

RuntimeMemory contains Go runtime memory statistics.

type SearchBookmarksQuery

type SearchBookmarksQuery struct {
	Q              string
	SortOrder      string
	Limit          int
	Cursor         string
	IncludeContent bool
}

SearchBookmarksQuery contains query parameters for searching bookmarks.

type SearchClient

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

SearchClient provides access to the search API.

func (*SearchClient) Autocomplete

func (s *SearchClient) Autocomplete(ctx context.Context, query, source string) ([]SearchResult, error)

Autocomplete performs a search autocomplete query. The source parameter filters by data source (optional).

func (*SearchClient) Search

func (s *SearchClient) Search(ctx context.Context, query, source string) ([]SearchResult, error)

Search performs a full-text search. The source parameter filters by data source (optional).

type SearchResult

type SearchResult struct {
	ID      string `json:"id"`
	Title   string `json:"title"`
	Content string `json:"content,omitempty"`
	Source  string `json:"source"`
	URL     string `json:"url,omitempty"`
}

SearchResult represents a single search result.

type ServerClient

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

ServerClient provides access to the server management API.

func (*ServerClient) Stacktrace

func (s *ServerClient) Stacktrace(ctx context.Context) (*StacktraceResult, error)

Stacktrace retrieves server diagnostic information including goroutine stack traces.

func (*ServerClient) Upload

func (s *ServerClient) Upload(ctx context.Context, files map[string]io.Reader, filenames map[string]string) (*UploadResult, error)

Upload uploads files to the server. files should be a map of field name to file content.

func (*ServerClient) UploadMultipart

func (s *ServerClient) UploadMultipart(ctx context.Context, writer *multipart.Writer, body io.Reader) (*UploadResult, error)

UploadMultipart uploads files using multipart form data.

type SetSubtaskEndTimeResult

type SetSubtaskEndTimeResult struct {
	Result bool `json:"result"`
}

SetSubtaskEndTimeResult contains the result of stopping a subtask timer.

type SetSubtaskStartTimeResult

type SetSubtaskStartTimeResult struct {
	Result bool `json:"result"`
}

SetSubtaskStartTimeResult contains the result of starting a subtask timer.

type StacktraceResult

type StacktraceResult struct {
	Timestamp  string    `json:"timestamp"`
	Process    Process   `json:"process"`
	Runtime    Runtime   `json:"runtime"`
	BuildInfo  BuildInfo `json:"build_info"`
	StackTrace string    `json:"stack_trace"`
}

StacktraceResult contains server diagnostic information.

type UpdateEntriesRequest

type UpdateEntriesRequest struct {
	EntryIDs []int64 `json:"entry_ids"`
	Status   string  `json:"status"`
}

UpdateEntriesRequest contains parameters for updating entries status.

type UpdateEntriesResult

type UpdateEntriesResult struct {
	Success bool `json:"success"`
}

UpdateEntriesResult contains the result of updating entries.

type UpdateFeedRequest

type UpdateFeedRequest struct {
	Title                       string `json:"title,omitempty"`
	FeedURL                     string `json:"feed_url,omitempty"`
	SiteURL                     string `json:"site_url,omitempty"`
	ScraperRules                string `json:"scraper_rules,omitempty"`
	RewriteRules                string `json:"rewrite_rules,omitempty"`
	UrlRewriteRules             string `json:"urlrewrite_rules,omitempty"`
	BlocklistRules              string `json:"blocklist_rules,omitempty"`
	KeeplistRules               string `json:"keeplist_rules,omitempty"`
	BlockFilterEntryRules       string `json:"block_filter_entry_rules,omitempty"`
	KeepFilterEntryRules        string `json:"keep_filter_entry_rules,omitempty"`
	UserAgent                   string `json:"user_agent,omitempty"`
	Cookie                      string `json:"cookie,omitempty"`
	Username                    string `json:"username,omitempty"`
	Password                    string `json:"password,omitempty"`
	Crawler                     *bool  `json:"crawler,omitempty"`
	IgnoreHTTPCache             *bool  `json:"ignore_http_cache,omitempty"`
	AllowSelfSignedCertificates *bool  `json:"allow_self_signed_certificates,omitempty"`
	FetchViaProxy               *bool  `json:"fetch_via_proxy,omitempty"`
	IgnoreEntryUpdates          *bool  `json:"ignore_entry_updates,omitempty"`
	DisableHTTP2                *bool  `json:"disable_http2,omitempty"`
	HideGlobally                *bool  `json:"hide_globally,omitempty"`
	Disabled                    *bool  `json:"disabled,omitempty"`
}

UpdateFeedRequest contains parameters for updating a feed.

type UpdateMemoRequest

type UpdateMemoRequest struct {
	Content    string `json:"content,omitempty"`
	Visibility string `json:"visibility,omitempty"`
	Pinned     *bool  `json:"pinned"`
}

UpdateMemoRequest is the request body for updating a memo.

type UploadResult

type UploadResult struct {
	Success bool     `json:"success"`
	URLs    []string `json:"result"`
}

UploadResult contains the result of uploading files.

type UserClient

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

UserClient provides access to the user API.

func (*UserClient) BookmarkList

func (u *UserClient) BookmarkList(ctx context.Context) ([]karakeep.Bookmark, error)

BookmarkList returns the user's bookmark list.

func (*UserClient) Dashboard

func (u *UserClient) Dashboard(ctx context.Context) (types.KV, error)

Dashboard returns dashboard data.

func (*UserClient) KanbanList

func (u *UserClient) KanbanList(ctx context.Context) ([]kanboard.Task, error)

KanbanList returns the user's kanban task list.

func (*UserClient) Metrics

func (u *UserClient) Metrics(ctx context.Context) (*MetricsResult, error)

Metrics returns system metrics.

type WorkflowClient

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

WorkflowClient provides access to the workflow execution API.

func (*WorkflowClient) RunFile

func (w *WorkflowClient) RunFile(ctx context.Context, filePath string) (*WorkflowRunResult, error)

RunFile uploads a workflow YAML file and runs it on the server.

type WorkflowRunResult

type WorkflowRunResult struct {
	Message string `json:"message"`
}

WorkflowRunResult is the response from a workflow run.

Jump to

Keyboard shortcuts

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