Skip to content

togo-framework/settings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

togo

togo-framework/settings

marketplace pkg.go.dev MIT

Part of the togo framework.

Install

togo install togo-framework/settings

settings — shared config store for togo

A togo plugin that gives every other plugin a shared, typed config store. Values are JSON, addressed by (scope, key) — use global, a plugin name, or a tenant id — and persisted in the kernel database.

togo install togo-framework/settings

Go API

s := settings.FromKernel(k)               // *settings.Store from the kernel
_ = s.Set(ctx, settings.ScopeGlobal, "site.title", "ToGO")
title, ok, _ := settings.Get[string](ctx, s, settings.ScopeGlobal, "site.title")
all, _ := s.All(ctx, "billing")           // every key in a scope
_ = s.Delete(ctx, "billing", "plan")

REST API

Method Path Body
GET /api/settings/{scope} — → {key: value}
GET /api/settings/{scope}/{key} — → value
PUT /api/settings/{scope}/{key} any JSON
DELETE /api/settings/{scope}/{key}

Data model

settings(scope text, skey text, value text json, PRIMARY KEY (scope, skey)) — created on boot. Cross-driver TEXT columns; upsert via ON CONFLICT.

MIT


Premium sponsors

ID8 Media  ·  One Studio

Support togo — become a sponsor.

About

Shared typed config store for togo — DB-backed, scoped, Go + REST API

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors

Languages