-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize xtemplate to expose cleaner Instance and Server features (#3)
* Clean up public interface * Refactor to expose a considered public interface for config/server/instance. * Make overrides public * Document Server and Instance * Adjust readme * Add to todo
- Loading branch information
Showing
15 changed files
with
922 additions
and
679 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM golang:1.21 AS build | ||
FROM golang:1.22 AS build | ||
|
||
WORKDIR /build | ||
COPY go.mod go.sum ./ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
# TODO | ||
|
||
- [ ] Add command to pre-compress all static files | ||
- Support SSE | ||
- [ ] Integrate nats subscription | ||
- [ ] Fix dockerfile | ||
- [ ] Create system for optional modules. Config/DB/FS/NATS. Inject? | ||
- [ ] Integrate nats: | ||
- [ ] Subscribe to subject, loop on receive to send via open SSE connection | ||
- [ ] Publish message to subject | ||
- [ ] Request-Reply | ||
|
||
### Automation | ||
|
||
|
@@ -23,9 +26,26 @@ | |
- [ ] Add a way to register additional routes dynamically during init | ||
- [ ] Organize docs according to https://diataxis.fr/ | ||
- [ ] Fine tune timeouts? https://ieftimov.com/posts/make-resilient-golang-net-http-servers-using-timeouts-deadlines-context-cancellation/ | ||
- [ ] Idea: Add special FILE pseudo-func that is replaced with a string constant of the current filename. | ||
- Potentially useful for invoking a template file with a relative path. (Add | ||
DIR constant too?) | ||
- Parse().Tree.Root.(*ListNode).[].(recurse) where NodeType()==NodeIdentifier replace with StringNode | ||
- [ ] Modify relative path invocations to point to the local path. https://pkg.go.dev/text/template/[email protected]#TemplateNode | ||
- Should be fine? | ||
- [ ] Add command that pre-compresses static files | ||
- [ ] Pass Config.Ctx down to http.Server/net.Listener to allow caller to cancel | ||
.Serve() and associated instances. | ||
|
||
# DONE | ||
|
||
## v0.4 - Mar 2024 | ||
|
||
- [x] Add library documentation | ||
- [x] Reorganize to expose different layers: | ||
- Config: Configure xtemplate | ||
- Instance: Serves as the local context and http.Handler | ||
- Server: Manages instances and lets you live reload live. | ||
|
||
## v0.3 - Mar 2024 | ||
|
||
- [x] Refactor watch to be easier to use from both Main() and xtemplate-caddy. | ||
|
Oops, something went wrong.