config

package
v0.0.0-...-fa720cf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseConfig

func ParseConfig(raw []byte, conf *Config) error

ParseConfig parses a YAML doc into the given Config instance.

func ParseConfigFile

func ParseConfigFile(relpath string, conf *Config) error

ParseConfigFile parses a config file, which is formatted in YAML, and returns a Config struct.

func TestifyConfig

func TestifyConfig(c *Config)

TestifyConfig randomizes ports and database paths/names

Types

type Config

type Config struct {
	Server    ServerConfig
	RPCClient rpc.Config
	Logger    log.Logger
	Default   string
	Graphs    map[string]string
	Drivers   map[string]DriverConfig
	Sources   map[string]string
}

Config describes the configuration for Grip.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns an instance of the default configuration for Grip.

func (*Config) AddBadgerDefault

func (conf *Config) AddBadgerDefault()

func (*Config) AddMongoDefault

func (conf *Config) AddMongoDefault()

func (*Config) AddPebbleDefault

func (conf *Config) AddPebbleDefault()

func (*Config) SetDefaults

func (c *Config) SetDefaults()

type DriverConfig

type DriverConfig struct {
	Grids         *string
	Badger        *string
	Bolt          *string
	Level         *string
	Pebble        *string
	Elasticsearch *elastic.Config
	MongoDB       *mongo.Config
	PSQL          *psql.Config
	ExistingSQL   *esql.Config
	Gripper       *gripper.Config
}

type DriverParams

type DriverParams interface {
	SetDefaults()
}

type ServerConfig

type ServerConfig struct {
	HostName         string
	HTTPPort         string
	RPCPort          string
	WorkDir          string
	ContentDir       string
	ReadOnly         bool
	EnablePlugins    bool
	PluginDir        string
	NoJobs           bool
	Accounts         accounts.Config
	DisableHTTPCache bool
	// Should the server periodically build the graph schemas?
	AutoBuildSchemas bool
	// How often the server should rebuild the graph schemas. Set to 0 to turn off
	SchemaRefreshInterval duration.Duration
	// How many vertices/edges to inspect to infer the schema
	SchemaInspectN uint32
	// Strategy to use for selecting the vertices/edges to inspect.
	// Random if True; first N otherwise
	SchemaRandomSample bool
	// Configure how the server logs requests
	RequestLogging struct {
		Enable bool
		// Which request headers to include the in the log
		HeaderWhitelist []string
	}
}

Config describes configuration for the server.

func (ServerConfig) HTTPAddress

func (c ServerConfig) HTTPAddress() string

HTTPAddress returns the HTTP address based on HostName and HTTPPort

func (*ServerConfig) RPCAddress

func (c *ServerConfig) RPCAddress() string

RPCAddress returns the RPC address based on HostName and RPCPort

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL