File: no_database_store.go

package info (click to toggle)
golang-github-canonical-go-dqlite 2.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 712 kB
  • sloc: sh: 380; makefile: 5
file content (20 lines) | stat: -rw-r--r-- 414 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// +build nosqlite3

package client

import (
	"strings"

	"github.com/pkg/errors"
)

// DefaultNodeStore creates a new NodeStore using the given filename.
//
// The filename must end with ".yaml".
func DefaultNodeStore(filename string) (NodeStore, error) {
	if strings.HasSuffix(filename, ".yaml") {
		return NewYamlNodeStore(filename)
	}

	return nil, errors.New("built without support for DatabaseNodeStore")
}