-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
782 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
namespace Fauna.Constants; | ||
|
||
/// <summary> | ||
/// Represents the endpoints used for accessing Fauna. | ||
/// </summary> | ||
public readonly struct Endpoints | ||
{ | ||
/// <summary> | ||
/// The default URI for Fauna, used for production. | ||
/// </summary> | ||
public static readonly Uri Default = new("https://db.fauna.com"); | ||
|
||
/// <summary> | ||
/// The local development URI for Fauna, used for testing or local development. | ||
/// </summary> | ||
public static readonly Uri Local = new("http://localhost:8443"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,63 @@ | ||
namespace Fauna.Constants; | ||
|
||
/// <summary> | ||
/// Contains constant values for HTTP header names used in Fauna API requests. | ||
/// </summary> | ||
internal readonly struct Headers | ||
{ | ||
/// <summary> | ||
/// Header for the authorization token in API requests. | ||
/// </summary> | ||
public const string Authorization = "Authorization"; | ||
|
||
/// <summary> | ||
/// Header indicating the minimum snapshot time for the query execution based on the highest transaction timestamp observed by the client. | ||
/// </summary> | ||
public const string LastTxnTs = "X-Last-Txn-Ts"; | ||
|
||
/// <summary> | ||
/// Header to enforce strictly serialized execution of the query, affecting read-only transactions. | ||
/// </summary> | ||
public const string Linearized = "X-Linearized"; | ||
|
||
/// <summary> | ||
/// Header indicating the maximum number of retries for a transaction due to contention failure before returning an error. | ||
/// </summary> | ||
public const string MaxContentionRetries = "X-Max-Contention-Retries"; | ||
|
||
/// <summary> | ||
/// Header specifying the query timeout in milliseconds. | ||
/// </summary> | ||
public const string QueryTimeoutMs = "X-Query-Timeout-Ms"; | ||
|
||
/// <summary> | ||
/// Header to enable or disable type checking of the query before evaluation. | ||
/// </summary> | ||
public const string TypeCheck = "X-Typecheck"; | ||
|
||
/// <summary> | ||
/// Header for passing custom, string-encoded tags for request identification in logs and responses. | ||
/// </summary> | ||
public const string QueryTags = "X-Query-Tags"; | ||
|
||
/// <summary> | ||
/// Header for the trace parent identifier in distributed tracing systems. | ||
/// </summary> | ||
public const string TraceParent = "Traceparent"; | ||
|
||
/// <summary> | ||
/// Header indicating the driver used for the API request. | ||
/// </summary> | ||
public const string Driver = "X-Driver"; | ||
|
||
/// <summary> | ||
/// Header for specifying the environment of the driver used in the API request. | ||
/// </summary> | ||
public const string DriverEnv = "X-Driver-Env"; | ||
|
||
/// <summary> | ||
/// Header for specifying the encoded format for query arguments and response data. | ||
/// Options are 'simple' and 'tagged'. 'Simple' is the default format. | ||
/// </summary> | ||
public const string Format = "X-Format"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,119 @@ | ||
namespace Fauna.Constants; | ||
|
||
/// <summary> | ||
/// Contains constant values for the response field names returned by Fauna API queries. | ||
/// </summary> | ||
internal readonly struct ResponseFields | ||
{ | ||
// Top-level fields | ||
#region Top-level fields | ||
|
||
/// <summary> | ||
/// Field name for the main data content of the response. | ||
/// </summary> | ||
public const string DataFieldName = "data"; | ||
|
||
/// <summary> | ||
/// Field name for the transaction timestamp of the last transaction seen by the request. | ||
/// </summary> | ||
public const string LastSeenTxnFieldName = "txn_ts"; | ||
|
||
/// <summary> | ||
/// Field name for static type information in the response. | ||
/// </summary> | ||
public const string StaticTypeFieldName = "static_type"; | ||
|
||
/// <summary> | ||
/// Field name for statistical information about the query execution. | ||
/// </summary> | ||
public const string StatsFieldName = "stats"; | ||
|
||
/// <summary> | ||
/// Field name for the schema version of the database at the time of query execution. | ||
/// </summary> | ||
public const string SchemaVersionFieldName = "schema_version"; | ||
|
||
/// <summary> | ||
/// Field name for the summary information about the query execution. | ||
/// </summary> | ||
public const string SummaryFieldName = "summary"; | ||
|
||
/// <summary> | ||
/// Field name for query tags associated with the request, used in logging and monitoring. | ||
/// </summary> | ||
public const string QueryTagsFieldName = "query_tags"; | ||
|
||
/// <summary> | ||
/// Field name for error information if the query fails. | ||
/// </summary> | ||
public const string ErrorFieldName = "error"; | ||
|
||
// "stats" block | ||
#endregion | ||
|
||
#region "stats" block | ||
|
||
/// <summary> | ||
/// Field name for the number of compute operations consumed by the query. | ||
/// </summary> | ||
public const string Stats_ComputeOpsFieldName = "compute_ops"; | ||
|
||
/// <summary> | ||
/// Field name for the number of read operations consumed by the query. | ||
/// </summary> | ||
public const string Stats_ReadOps = "read_ops"; | ||
|
||
/// <summary> | ||
/// Field name for the number of write operations consumed by the query. | ||
/// </summary> | ||
public const string Stats_WriteOps = "write_ops"; | ||
|
||
/// <summary> | ||
/// Field name for the query processing time in milliseconds. | ||
/// </summary> | ||
public const string Stats_QueryTimeMs = "query_time_ms"; | ||
|
||
/// <summary> | ||
/// Field name for the write contention retry count. | ||
/// </summary> | ||
public const string Stats_ContentionRetries = "contention_retries"; | ||
|
||
/// <summary> | ||
/// Field name for the amount of data read from storage, in bytes. | ||
/// </summary> | ||
public const string Stats_StorageBytesRead = "storage_bytes_read"; | ||
|
||
/// <summary> | ||
/// Field name for the amount of data written to storage, in bytes. | ||
/// </summary> | ||
public const string Stats_StorageBytesWrite = "storage_bytes_write"; | ||
|
||
/// <summary> | ||
/// Field name for the types of operations that were limited or approaching rate limits. | ||
/// </summary> | ||
public const string Stats_RateLimitsHit = "rate_limits_hit"; | ||
|
||
// "error" block | ||
#endregion | ||
|
||
#region "error" block | ||
|
||
/// <summary> | ||
/// Field name for the error code when a query fails. | ||
/// </summary> | ||
public const string Error_CodeFieldName = "code"; | ||
|
||
/// <summary> | ||
/// Field name for the detailed message describing the cause of the error. | ||
/// </summary> | ||
public const string Error_MessageFieldName = "message"; | ||
|
||
/// <summary> | ||
/// Field name for constraint failures that occurred during the query. | ||
/// </summary> | ||
public const string Error_ConstraintFailuresFieldName = "constraint_failures"; | ||
|
||
/// <summary> | ||
/// Field name for information about an abort operation within a transaction. | ||
/// </summary> | ||
public const string Error_AbortFieldName = "abort"; | ||
|
||
#endregion | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.