Esempio n. 1
0
// Create a new client store using the given path.
func NewFDB(path string) (Store, error) {
	if path == "" {
		path = RecommendedPath
	}

	db, err := fdb.Open(fdb.Config{
		Path:        path,
		Permissions: storePermissions,
	})
	if err != nil {
		return nil, err
	}

	s := &fdbStore{
		db:   db,
		path: path,
	}

	err = s.Reload()
	if err != nil {
		return nil, err
	}

	return s, nil
}
Esempio n. 2
0
// Create a new client store using the given path.
func New(path string) (*Store, error) {
	if path == "" {
		path = RecommendedPath
	}

	db, err := fdb.Open(fdb.Config{
		Path:        path,
		Permissions: storePermissions,
	})
	if err != nil {
		return nil, err
	}

	s := &Store{
		db:             db,
		path:           path,
		defaultBaseURL: acmeapi.DefaultDirectoryURL,
	}

	err = s.load()
	if err != nil {
		return nil, err
	}

	return s, nil
}