mirror of https://github.com/status-im/fathom.git
20 lines
357 B
Go
20 lines
357 B
Go
package api
|
|
|
|
import (
|
|
"github.com/gorilla/sessions"
|
|
"github.com/usefathom/fathom/pkg/datastore"
|
|
)
|
|
|
|
type API struct {
|
|
database datastore.Datastore
|
|
sessions sessions.Store
|
|
}
|
|
|
|
// New instantiates a new API object
|
|
func New(db datastore.Datastore, secret string) *API {
|
|
return &API{
|
|
database: db,
|
|
sessions: sessions.NewCookieStore([]byte(secret)),
|
|
}
|
|
}
|