diff --git a/cmd/ipfs-cluster-service/main.go b/cmd/ipfs-cluster-service/main.go index 593c8d6a..8ee1b1d2 100644 --- a/cmd/ipfs-cluster-service/main.go +++ b/cmd/ipfs-cluster-service/main.go @@ -37,6 +37,7 @@ const programName = "ipfs-cluster-service" const ( defaultLogLevel = "info" defaultConsensus = "crdt" + defaultDatastore = "pebble" ) const ( @@ -273,7 +274,7 @@ the peer IDs in the given multiaddresses. }, cli.StringFlag{ Name: "datastore", - Usage: datastoreFlagUsage, + Usage: "select datastore: 'badger', 'badger3', 'leveldb' or 'pebble'", Value: defaultDatastore, }, cli.BoolFlag{ diff --git a/cmd/ipfs-cluster-service/pebble_disabled.go b/cmd/ipfs-cluster-service/pebble_disabled.go deleted file mode 100644 index 331a5ee6..00000000 --- a/cmd/ipfs-cluster-service/pebble_disabled.go +++ /dev/null @@ -1,8 +0,0 @@ -//go:build arm || 386 || (openbsd && amd64) - -package main - -const ( - defaultDatastore = "badger3" - datastoreFlagUsage = "select datastore: 'badger', 'badger3' or 'leveldb'" -) diff --git a/cmd/ipfs-cluster-service/pebble_enabled.go b/cmd/ipfs-cluster-service/pebble_enabled.go deleted file mode 100644 index d73a584c..00000000 --- a/cmd/ipfs-cluster-service/pebble_enabled.go +++ /dev/null @@ -1,8 +0,0 @@ -//go:build !arm && !386 && !(openbsd && amd64) - -package main - -const ( - defaultDatastore = "pebble" - datastoreFlagUsage = "select datastore: 'badger', 'badger3', 'leveldb' or 'pebble'" -) diff --git a/datastore/pebble/config.go b/datastore/pebble/config.go index 9b12ffc7..f61b65b4 100644 --- a/datastore/pebble/config.go +++ b/datastore/pebble/config.go @@ -1,5 +1,3 @@ -//go:build !arm && !386 && !(openbsd && amd64) - package pebble import ( diff --git a/datastore/pebble/pebble.go b/datastore/pebble/pebble.go index fd8132ca..c8e96593 100644 --- a/datastore/pebble/pebble.go +++ b/datastore/pebble/pebble.go @@ -1,5 +1,3 @@ -//go:build !arm && !386 && !(openbsd && amd64) - // Package pebble provides a configurable Pebble database backend for use with // IPFS Cluster. package pebble diff --git a/datastore/pebble/pebble_disabled.go b/datastore/pebble/pebble_disabled.go deleted file mode 100644 index cbc7fa74..00000000 --- a/datastore/pebble/pebble_disabled.go +++ /dev/null @@ -1,75 +0,0 @@ -//go:build arm || 386 || (openbsd && amd64) - -package pebble - -import ( - "errors" - - "github.com/ipfs-cluster/ipfs-cluster/config" - ds "github.com/ipfs/go-datastore" -) - -// ErrUnsupported is returned when trying to do something with this datastore -// backend. -var ErrUnsupported = errors.New("Pebble is unsupported in this OS/arch combination") - -const configKey = "pebble" -const envConfigKey = "cluster_pebble" - -// Config is a placeholder object for architectures where pebble is unsupported. -type Config struct { - config.Saver -} - -// ConfigKey returns a human-friendly identifier for this type of Datastore. -func (cfg *Config) ConfigKey() string { - return configKey -} - -// Default initializes this Config with sensible values. -func (cfg *Config) Default() error { - return nil -} - -// ApplyEnvVars fills in any Config fields found as environment variables. -func (cfg *Config) ApplyEnvVars() error { - return nil -} - -// Validate checks that the fields of this Config have working values, -// at least in appearance. -func (cfg *Config) Validate() error { - return nil -} - -// LoadJSON reads the fields of this Config from a JSON byteslice as -// generated by ToJSON. -func (cfg *Config) LoadJSON(raw []byte) error { - return nil -} - -// ToJSON generates a JSON-formatted human-friendly representation of this -// Config. -func (cfg *Config) ToJSON() (raw []byte, err error) { - return []byte("{}"), ErrUnsupported -} - -// GetFolder returns the Pebble folder. -func (cfg *Config) GetFolder() string { - return "" -} - -// ToDisplayJSON returns JSON config as a string. -func (cfg *Config) ToDisplayJSON() ([]byte, error) { - return nil, nil -} - -// New returns always ErrUnsupported -func New(cfg *Config) (ds.Datastore, error) { - return nil, ErrUnsupported -} - -// Cleanup does nothing -func Cleanup(cfg *Config) error { - return ErrUnsupported -}