grafbase_local_common/
consts.rs

1use std::ops::Range;
2
3/// the default port on which the server will run
4pub const DEFAULT_PORT: u16 = 4000;
5/// the max port to use when searching for an available port
6pub const MAX_PORT: u16 = u16::MAX;
7/// localhost IP
8pub const LOCALHOST: &str = "127.0.0.1";
9/// the name of the directory indicating a grafbase project
10pub const GRAFBASE_DIRECTORY_NAME: &str = "grafbase";
11/// a file expected to be in the grafbase directory
12pub const GRAFBASE_SCHEMA_FILE_NAME: &str = "schema.graphql";
13/// a file expected to be in the grafbase directory
14pub const GRAFBASE_ENV_FILE_NAME: &str = ".env";
15/// the name for the db / cache directory per project and the global cache directory for the user
16pub const DOT_GRAFBASE_DIRECTORY: &str = ".grafbase";
17/// the registry.json file generated from schema.graphql
18pub const REGISTRY_FILE: &str = "registry.json";
19/// the /resolvers directory containing resolver implementations
20pub const RESOLVERS_DIRECTORY_NAME: &str = "resolvers";
21/// the tracing filter to be used when tracing is on
22pub const TRACE_LOG_FILTER: &str = "grafbase=trace,grafbase_local_common=trace,grafbase_local_server=trace,grafbase_local_backend=trace,tower_http=debug";
23/// the tracing filter to be used when tracing is off
24pub const DEFAULT_LOG_FILTER: &str = "off";
25/// the range suggested for ephemeral ports by IANA
26pub const EPHEMERAL_PORT_RANGE: Range<u16> = 49152..65535;
27/// the subdirectory within '$PROJECT/.grafbase' containing the database
28pub const DATABASE_DIRECTORY: &str = "database";