Compare commits
11 Commits
52405411d3
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| f9ef9bfba2 | |||
| 6b505a5da8 | |||
| 0e48b345eb | |||
| 649134422e | |||
| 5587583ed3 | |||
| 77c60de4f8 | |||
| e591c5a4ae | |||
| 6428dd2157 | |||
| 5cf0f637f8 | |||
| 6b47951ff8 | |||
| 9527311a12 |
70
.gitea/workflows/test.yml
Normal file
70
.gitea/workflows/test.yml
Normal 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
27
CHANGELOG.md
Normal 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
39
README.md
Normal 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)
|
||||
@@ -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() {
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"git.hrafn.xyz/aether/gotes/client"
|
||||
"git.hrafn.xyz/aether/gotes/internal/cli/client"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -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
|
||||
|
||||
4
justfile
4
justfile
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user