daemon

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodePayload

func DecodePayload(payload map[string]any, target any) error

func WriteRequest

func WriteRequest(w io.Writer, request Request) error

func WriteResponse

func WriteResponse(w io.Writer, response Response) error

Types

type Backend

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

func NewBackend

func NewBackend(repo *store.Repository, kgStore *kg.Store, diaryStore *diary.Store, paths xdg.Paths, provider vector.Provider) *Backend

func (*Backend) Close

func (b *Backend) Close() error

func (*Backend) Handle

func (b *Backend) Handle(ctx context.Context, request Request) Response

type CorpusDocumentPayload

type CorpusDocumentPayload struct {
	ID        string `json:"id"`
	Content   string `json:"content"`
	Mode      string `json:"mode,omitempty"`
	Extract   string `json:"extract,omitempty"`
	Depth     int    `json:"depth,omitempty"`
	CreatedAt string `json:"created_at,omitempty"`
	UpdatedAt string `json:"updated_at,omitempty"`
}

type EnsureCorpusPayload

type EnsureCorpusPayload struct {
	Key       string                  `json:"key"`
	Documents []CorpusDocumentPayload `json:"documents"`
}

type Request

type Request struct {
	ID      string         `json:"id"`
	Command string         `json:"command"`
	Payload map[string]any `json:"payload,omitempty"`
}

func ReadRequest

func ReadRequest(r io.Reader) (Request, error)

type Response

type Response struct {
	ID      string         `json:"id"`
	Success bool           `json:"success"`
	Payload map[string]any `json:"payload,omitempty"`
	Error   string         `json:"error,omitempty"`
}

func Call

func Call(ctx context.Context, socketPath string, request Request) (Response, error)

func ReadResponse

func ReadResponse(r io.Reader) (Response, error)

type SearchCorpusPayload

type SearchCorpusPayload struct {
	Key   string `json:"key"`
	Query string `json:"query"`
	Limit int    `json:"limit,omitempty"`
}

type Server

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

func NewServer

func NewServer(socketPath string, backend *Backend) *Server

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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