Default to SQLite rather than Postgres & Redis (#72)
* Initial rough draft switch to sqlite. * Rewrote cache implemenation. * Provide typed tasks. * Task cleanup. * Use same db for tasks. * Provide task queue registration and service container injection. * Added optional delay to tasks. Pool buffers when encoding. * Added tests for the task client and runner. * Added handler examples for caching and tasks. * Cleanup and documentation. * Use make in workflow. * Updated documentation. * Updated documentation.
This commit is contained in:
parent
5e9e502b42
commit
a096abd195
29 changed files with 956 additions and 910 deletions
36
templates/pages/cache.gohtml
Normal file
36
templates/pages/cache.gohtml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{{define "content"}}
|
||||
<form id="task" method="post" hx-post="{{url "cache.submit"}}">
|
||||
<article class="message">
|
||||
<div class="message-header">
|
||||
<p>Test the cache</p>
|
||||
</div>
|
||||
<div class="message-body">
|
||||
This route handler shows how the default in-memory cache works. Try updating the value using the form below and see how it persists after you reload the page.
|
||||
HTMX makes it easy to re-render the cached value after the form is submitted.
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<label for="value" class="label">Value in cache: </label>
|
||||
{{if .Data}}
|
||||
<span class="tag is-success">{{.Data}}</span>
|
||||
{{- else}}
|
||||
<i>(empty)</i>
|
||||
{{- end}}
|
||||
<br/><br/>
|
||||
|
||||
<div class="field">
|
||||
<label for="value" class="label">Value</label>
|
||||
<div class="control">
|
||||
<input id="value" name="value" class="input" value="{{.Form.Value}}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field is-grouped">
|
||||
<div class="control">
|
||||
<button class="button is-link">Update cache</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "csrf" .}}
|
||||
</form>
|
||||
{{end}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue