Documentation ¶
Overview ¶
bbolt represents a bbolt extension for the why server. bbolt is a key-value storage that can be used to persistently store and access data in why.
Set data:
bbolt.set("users", "test@test.com", { name: "John Do", age: 23 })
Get data:
user := bbolt.get("users", "test@test.com") name := user.name age := user.age
Iterate over data:
bbolt.iterate("users", func(key, value) { email := key name := value.name age := value.age return true // return false if you want to stop the iteration })
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Extension ¶
type Extension struct {
// contains filtered or unexported fields
}
Extension represents the bbolt extension for the why server.
func (*Extension) Bolt ¶
Bolt returns the connection to bbolt. This can be useful if you setup your own server and add the extension manually. This way you can access bolt directly and insert data from within your backend.
func (*Extension) Hook ¶
func (e *Extension) Hook(sc *script.Compiled, w io.Writer, resp http.ResponseWriter, r *http.Request) error
Hook will add a variable called 'bbolt' to the script runtime that contains functions to access bbolt.
Click to show internal directories.
Click to hide internal directories.