Compare commits

...

11 Commits

Author SHA1 Message Date
f9ef9bfba2 docs: add aspirational targets
Some checks failed
test / go-test (push) Failing after 1m1s
2026-03-22 20:25:27 +00:00
6b505a5da8 refactor(go): enforce notestore interface 2026-03-22 20:25:00 +00:00
0e48b345eb docs(changelog): add notes to changelog
Some checks failed
test / go-test (push) Failing after 1m6s
2026-03-22 19:38:31 +00:00
649134422e docs(changelog): create changelog 2026-03-22 19:37:41 +00:00
5587583ed3 docs: adding readme.md 2026-03-22 19:35:12 +00:00
77c60de4f8 Correcting project layout 2026-03-22 19:33:22 +00:00
e591c5a4ae Need the target dir to exist!
Some checks failed
test / go-test (push) Failing after 6m59s
2026-03-19 01:37:48 +00:00
6428dd2157 Cache me outside?
Some checks failed
test / go-test (push) Has been cancelled
2026-03-19 01:36:09 +00:00
5cf0f637f8 -v not --verbose
Some checks failed
test / go-test (push) Failing after 6m2s
2026-03-19 01:23:42 +00:00
6b47951ff8 Decouple workflow from just
Some checks failed
test / go-test (push) Failing after 5m13s
2026-03-19 01:16:13 +00:00
9527311a12 Adding testing workflow
Some checks failed
test / go-test (push) Failing after 7m23s
2026-03-19 01:03:21 +00:00
9 changed files with 143 additions and 4 deletions

70
.gitea/workflows/test.yml Normal file
View File

@@ -0,0 +1,70 @@
name: test
on:
push:
pull_request:
env:
build_path: _build
jobs:
go-test:
env:
RUNNER_TOOL_CACHE: /cache/tools
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.26.x"
- name: Get go-hashfiles
uses: https://gitea.com/actions/go-hashfiles@v0.0.1
id: hash-go
with:
patterns: |-
go.mod
go.sum
- name: Echo hash
run: echo ${{ steps.hash-go.outputs.hash }}
- name: Cache go
id: cache-go
uses: https://github.com/actions/cache@v3 # Action cache
with: # specify with your GOMODCACHE and GOCACHE
path: |-
/root/go/pkg/mod
/root/.cache/go-build
key: go_cache-${{ steps.hash-go.outputs.hash }}
restore-keys: |-
go_cache-${{ steps.hash-go.outputs.hash }}
- name: Check Formatting
run: |
gofmt -l .
exit $(gofmt -l . | wc -l)
- name: Run tests
run: go test -v ./...
- name: Generate coverage
run: |
mkdir -p ${build_path}
go test -v -coverprofile=${build_path}/coverage.out ./...
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: _build/coverage.out
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: true
hide_complexity: false
indicators: true
output: both
thresholds: '60 80'

27
CHANGELOG.md Normal file
View File

@@ -0,0 +1,27 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
A `### Breaking` section is used in addition to Keep a Changelog's standard sections to explicitly document changes that are backwards-incompatible but would otherwise appear under `### Changed`. Entries under `### Breaking` trigger a major version bump in automated release recommendation logic.
## [Unreleased]
### Breaking
### Added
- SQLite based server
- Simple CLI for interacting with server
### Changed
### Removed
### Fixed
[Unreleased]: https://git.hrafn.xyz/aether/vociferate/compare/894c2fb...main

39
README.md Normal file
View File

@@ -0,0 +1,39 @@
# Gotes
A simple golang based notes application
## Current state
Server application runs independantly & binds to port 8080 storing data in an sqlite table
Client CLI supports crud operations for notes with arguments consumed from flags
## TODO
- [ ] Implement `title` support in cli
- [ ] Refactor cli interactions to use a repository/notes interface wrapped implementation
- [ ] General project structure tidy up
- [ ] Update simplecli to use positional arguments comined with flags
- [ ] Create unified cmd entry point starting server in go routine closing after command completed
- [ ] Create config module for controlling server startup config
- [ ] Implement filesystem based notestore
- [ ] Implement webdav based notestore
- [ ] Implement git based notestore
- [ ] Create TUI based on charmbracelet eco system
### Target structure
|- config
|- cmd
| |- CLI (contains unified entrypoint with positional args for starting server / client ops)
| |- UnifiedCLI (CLI with auto background server)
| |- TUI
|- internal
| |- models
| |- repository
| | |- notes
| | | |- sqlite
| | | |- server
| | | |- filesystem ... etc
| |- service
| | | |- notes
| |- config
| |- handlers (HTTP server handlers)

View File

@@ -9,7 +9,7 @@ import (
"git.hrafn.xyz/aether/gotes/internal/repository"
"git.hrafn.xyz/aether/gotes/internal/store/sqlite"
"git.hrafn.xyz/aether/gotes/server"
"git.hrafn.xyz/aether/gotes/internal/cli/server"
)
func main() {

View File

@@ -5,7 +5,7 @@ import (
"log"
"os"
"git.hrafn.xyz/aether/gotes/client"
"git.hrafn.xyz/aether/gotes/internal/cli/client"
)
func main() {

View File

@@ -10,6 +10,7 @@ import (
"modernc.org/sqlite"
"git.hrafn.xyz/aether/gotes/internal/models"
"git.hrafn.xyz/aether/gotes/internal/repository"
)
const sqlSet = `
@@ -17,6 +18,8 @@ const sqlSet = `
PRAGMA busy_timeout = 7000;
`
var _ repository.NoteStore = &SQLiteStore{}
type SQLiteStore struct {
read *sql.DB
write *sql.DB

View File

@@ -16,12 +16,12 @@ build: clean
build-server:
@echo "Building the isolated server..."
@rm -f {{ build_path }}/{{ server_exec_name }}
go build -o {{ build_path }}/{{ server_exec_name }} -ldflags="-s -w" isolated/server/main.go
go build -o {{ build_path }}/{{ server_exec_name }} -ldflags="-s -w" cmd/server/main.go
build-simplecli:
@echo "Building the simple cli..."
@rm -f {{ build_path }}/{{ simplecli_exec_name }}
go build -o {{ build_path }}/{{ simplecli_exec_name }} -ldflags="-s -w" isolated/simplecli/main.go
go build -o {{ build_path }}/{{ simplecli_exec_name }} -ldflags="-s -w" cmd/simplecli/main.go
# Run tests with short output