boltstore/store/config.go

23 lines
485 B
Go
Raw Normal View History

2014-06-14 20:15:10 +04:00
package store
2014-06-13 22:36:36 +04:00
2014-06-14 20:15:10 +04:00
import (
"github.com/gorilla/sessions"
"github.com/yosssi/boltstore/shared"
)
2014-06-13 22:36:36 +04:00
// Config represents a config for a session store.
type Config struct {
SessionOptions sessions.Options
DBOptions Options
}
// setDefault sets default to the config.
func (c *Config) setDefault() {
if c.SessionOptions.Path == "" {
2014-06-14 20:15:10 +04:00
c.SessionOptions.Path = shared.DefaultPath
2014-06-13 22:36:36 +04:00
}
if c.DBOptions.BucketName == nil {
2014-06-14 20:15:10 +04:00
c.DBOptions.BucketName = []byte(shared.DefaultBucketName)
2014-06-13 22:36:36 +04:00
}
}