sapling/eden/fs/config/eden_config.thrift
Chad Austin e2d26877d6 enable py3 thrift language
Summary:
The old `py` Thrift language support doesn't correctly handle string
vs. bytes, which causes an exception to be thrown when deserializing
paths or blobs that aren't UTF-8.

We will eventually want to migrate to the py3 language implementation,
which supports streaming.

Reviewed By: genevievehelsel

Differential Revision: D21693082

fbshipit-source-id: 0ea10fd3960f5acba353bccb83b5cf539e7eeffb
2020-06-10 19:29:17 -07:00

50 lines
1.5 KiB
Thrift

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
namespace cpp2 facebook.eden
namespace java com.facebook.eden.thrift
namespace py facebook.eden.eden_config
namespace py3 eden.fs.config
/**
* ConfigSource identifies the point of origin of a config setting.
* It is ordered from low to high precedence. Higher precedence
* configuration values over-ride lower precedence values. A config
* setting of CommandLine takes precedence over all other settings.
*/
enum ConfigSource {
Default = 0
SystemConfig = 1
UserConfig = 2
CommandLine = 3
}
enum ConfigReloadBehavior {
// Automatically reload the configuration file from disk if it appears to be
// necessary.
AutoReload = 0
// Do not reload the config from disk, and return the current cached values.
NoReload = 1
// Always attempt to reload the config from disk, even if we have recently
// checked to see if it was up-to-date.
ForceReload = 2
}
struct ConfigValue {
// parsedValue contains the value parsed by Eden, after performing variable
// substitution (${HOME}, ${USER}, etc)
// TODO: In the future it may be nice to add a sourceValue field that
// contains the original value from before variable interpolation. We don't
// currently store this data after performing parsing, however.
1: string parsedValue
2: ConfigSource source
}
struct EdenConfigData {
1: map<string, ConfigValue> values
}