bookstack-api/http.go
Oliver Jakoubek 62e299192d Set up Go module and project structure
- Populated .gitignore with Go-specific patterns
- Created placeholder Go files with basic package structure:
  - bookstack.go: Client and Config setup
  - types.go: Data structures (Book, Page, Chapter, Shelf, SearchResult)
  - errors.go: Error handling types with sentinel errors
  - http.go: HTTP helper placeholder with ListOptions
  - books.go, pages.go, chapters.go, shelves.go, search.go: Service placeholders
- Verified build succeeds with go build ./...
- No external dependencies added (stdlib only)

All files compile successfully and follow flat package structure.
2026-01-30 09:36:58 +01:00

28 lines
1,020 B
Go

package bookstack
import (
"context"
"net/http"
)
// buildRequest creates an HTTP request with proper authentication headers.
// TODO: Implement request building with Authorization header (Token <id>:<secret>)
func (c *Client) buildRequest(ctx context.Context, method, path string, body interface{}) (*http.Request, error) {
// Placeholder for future implementation
return nil, nil
}
// doRequest executes an HTTP request and handles the response.
// TODO: Implement response handling, error parsing, and JSON unmarshaling
func (c *Client) doRequest(ctx context.Context, req *http.Request, v interface{}) error {
// Placeholder for future implementation
return nil
}
// ListOptions contains common options for list operations.
type ListOptions struct {
Count int // Max items per page (default 100, max 500)
Offset int // Offset for pagination
Sort string // Sort field (e.g., "name", "-created_at")
Filter map[string]string // Filters (e.g., {"name": "value"})
}