mirror of https://github.com/danielmiessler/fabric
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
358 B
Go
22 lines
358 B
Go
package db
|
|
|
|
type Contexts struct {
|
|
*Storage
|
|
}
|
|
|
|
// GetContext Load a context from file
|
|
func (o *Contexts) GetContext(name string) (ret *Context, err error) {
|
|
var content []byte
|
|
if content, err = o.Load(name); err != nil {
|
|
return
|
|
}
|
|
|
|
ret = &Context{Name: name, Content: string(content)}
|
|
return
|
|
}
|
|
|
|
type Context struct {
|
|
Name string
|
|
Content string
|
|
}
|