76 lines
1.8 KiB
Go
76 lines
1.8 KiB
Go
//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("{}"), nil
|
|
}
|
|
|
|
// 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
|
|
}
|