62c53a6b4d
* 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.
36 lines
1.2 KiB
Plaintext
36 lines
1.2 KiB
Plaintext
{{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}} |