fabric/db/contexts.go

22 lines
358 B
Go
Raw Normal View History

2024-08-16 19:43:27 +00:00
package db
type Contexts struct {
*Storage
}
// GetContext Load a context from file
func (o *Contexts) GetContext(name string) (ret *Context, err error) {
2024-08-16 19:43:27 +00:00
var content []byte
if content, err = o.Load(name); err != nil {
2024-08-16 19:43:27 +00:00
return
}
ret = &Context{Name: name, Content: string(content)}
return
}
type Context struct {
Name string
Content string
}