httpapi

package
v0.0.0-...-8059097 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppendKVRequest

type AppendKVRequest struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type AppendRowRequest

type AppendRowRequest struct {
	RowKey string `json:"rowKey"`
	// column name -> base64 encoded value
	Columns map[string]string `json:"columns"`
}

type BackupSegmentEntry

type BackupSegmentEntry struct {
	SegmentID uint32 `json:"segmentId"`
	Path      string `json:"path"`
}

type BackupSegmentsRequest

type BackupSegmentsRequest struct {
	AfterSegmentID uint32 `json:"afterSegmentId"`
	BackupDir      string `json:"backupDir"`
}

type BackupSegmentsResponse

type BackupSegmentsResponse struct {
	Backups []BackupSegmentEntry `json:"backups"`
}

type BatchKVItem

type BatchKVItem struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

BatchKVItem represents a single KV item in a batch.

type BatchKVRequest

type BatchKVRequest struct {
	// "put" or "delete"
	Operation string        `json:"operation"`
	Items     []BatchKVItem `json:"items"`
	Keys      []string      `json:"keys"`
}

BatchKVRequest represents batch operations request.

type BatchKVResponse

type BatchKVResponse struct {
	Success bool `json:"success"`
	Count   int  `json:"count"`
}

BatchKVResponse represents batch operations response.

type BatchRowItem

type BatchRowItem struct {
	RowKey  string            `json:"rowKey"`
	Columns map[string]string `json:"columns"`
}

type BatchRowsRequest

type BatchRowsRequest struct {
	Operation string         `json:"operation"`
	Rows      []BatchRowItem `json:"rows"`
}

type BatchRowsResponse

type BatchRowsResponse struct {
	Success bool `json:"success"`
	Count   int  `json:"count"`
}

type BeginTransactionRequest

type BeginTransactionRequest struct {
	Operation string `json:"operation"`
	EntryType string `json:"entryType"`
}

type BeginTransactionResponse

type BeginTransactionResponse struct {
	TxnID   string `json:"txnId"`
	Success bool   `json:"success"`
}

type BtreeBackupRequest

type BtreeBackupRequest struct {
	Path string `json:"path"`
}

type BtreeBackupResponse

type BtreeBackupResponse struct {
	Path  string `json:"path"`
	Bytes int64  `json:"bytes"`
}

type CheckpointResponse

type CheckpointResponse struct {
	RecordProcessed uint64 `json:"recordProcessed"`
	SegmentID       uint32 `json:"segmentId"`
	Offset          int64  `json:"offset"`
}

type CommitTransactionResponse

type CommitTransactionResponse struct {
	Success  bool   `json:"success"`
	Checksum uint32 `json:"checksum,omitempty"`
}

type DeleteColumnsRequest

type DeleteColumnsRequest struct {
	// column name -> base64 encoded value
	Columns map[string]string `json:"columns"`
}

type DeleteColumnsResponse

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

type DeleteKVResponse

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

type DeleteRowResponse

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

type GetKVResponse

type GetKVResponse struct {
	// base64 encoded value
	Value string `json:"value"`
	Found bool   `json:"found"`
}

type GetRowResponse

type GetRowResponse struct {
	// column name -> base64 encoded value
	Columns map[string]string `json:"columns"`
	Found   bool              `json:"found"`
}

type HealthResponse

type HealthResponse struct {
	Status     string   `json:"status"`
	Namespaces []string `json:"namespaces"`
}

type OffsetResponse

type OffsetResponse struct {
	SegmentID uint32 `json:"segmentId"`
	Offset    int64  `json:"offset"`
}

type PutKVRequest

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

type PutKVResponse

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

type PutRowRequest

type PutRowRequest struct {
	// column name -> base64 encoded value
	Columns map[string]string `json:"columns"`
}

type PutRowResponse

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

type Service

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

Service implements HTTP API handlers for UnisonDB.

func NewService

func NewService(engines map[string]*dbkernel.Engine) *Service

NewService creates a new HTTP API service.

func (*Service) Close

func (s *Service) Close()

func (*Service) HandleHealth

func (s *Service) HandleHealth(w http.ResponseWriter, r *http.Request)

HandleHealth handles the /health endpoint for server health checks.

func (*Service) RegisterRoutes

func (s *Service) RegisterRoutes(router *mux.Router)

RegisterRoutes registers all HTTP API routes with the given router.

type StatsResponse

type StatsResponse struct {
	Namespace      string `json:"namespace"`
	OpsReceived    uint64 `json:"opsReceived"`
	OpsFlushed     uint64 `json:"opsFlushed"`
	CurrentSegment uint32 `json:"currentSegment"`
	CurrentOffset  int64  `json:"currentOffset"`
}

Jump to

Keyboard shortcuts

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