Add direct client methods for project/board operations:
- GetAllProjects(ctx) - list all accessible projects
- GetProjectByID(ctx, projectID) - get project by ID
- GetProjectByName(ctx, name) - get project by name
All methods:
- Use context for cancellation support
- Return ErrProjectNotFound when project doesn't exist
- Properly wrap errors with context
Closes: kanboard-api-apl
Add custom Timestamp type that wraps time.Time for Kanboard's
Unix timestamp format:
UnmarshalJSON supports:
- Unix timestamps as integers
- Empty strings and "0" strings as zero time
- Null values as zero time
- Numeric strings (e.g., "1609459200")
MarshalJSON returns:
- 0 for zero time
- Unix timestamp for non-zero time
Includes comprehensive tests for round-trip marshaling
and struct embedding scenarios.
Closes: kanboard-api-25y
Add full client configuration with fluent builder pattern:
- WithTimeout(duration) - configurable request timeout
- WithLogger(slog.Logger) - optional debug logging
- DefaultTimeout constant (30 seconds)
- Default HTTP client with timeout on construction
All fluent methods return same client instance for chaining.
Client is thread-safe for concurrent use.
Closes: kanboard-api-uls
Add comprehensive tests for HTTP Basic Auth support:
- API token authentication (jsonrpc + token)
- Username/password authentication
- Verify no auth header when unconfigured
- Fluent configuration method chaining
- Auth overwrite behavior
The auth implementation was completed in the previous commit
as a dependency for JSON-RPC client.
Closes: kanboard-api-k33
Add core JSON-RPC 2.0 protocol implementation for Kanboard API:
- JSONRPCRequest/Response/Error structs with proper JSON tags
- Generic call() method for sending requests and parsing responses
- Thread-safe request ID generation using atomic.Int64
- Automatic /jsonrpc.php path appending to baseURL
- Support for subdirectory installations
- HTTP Basic Auth support (API token and username/password)
- Error handling for unauthorized/forbidden responses
Includes comprehensive tests with httptest mock server.
Closes: kanboard-api-2g1