Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
docs updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Apr 22, 2024
1 parent fbb607c commit e5006cf
Show file tree
Hide file tree
Showing 12 changed files with 96 additions and 93 deletions.
48 changes: 0 additions & 48 deletions docfx.json

This file was deleted.

27 changes: 0 additions & 27 deletions index.md

This file was deleted.

14 changes: 10 additions & 4 deletions pkgs/sdk/server/docs-src/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# Notes on in-code documentation for this project

All public types, methods, and properties should have documentation comments in the standard C# XML comment format. These will be automatically included in the [HTML documentation](https://launchdarkly.github.io/dotnet-server-sdk) that is generated on release.
All public types, methods, and properties should have documentation comments in the standard C# XML comment format.
These will be automatically included in the [HTML documentation](https://launchdarkly.github.io/dotnet-server-sdk) that is generated on release.

Non-public items may have documentation comments as well, since those may be helpful to other developers working on this project, but they will not be included in the HTML documentation.
Non-public items may have documentation comments as well, since those may be helpful to other developers working on this
project, but they will not be included in the HTML documentation.

The HTML documentation also includes documentation comments from `LaunchDarkly.CommonSdk`. These are included automatically when the documentation is built on release, so that developers can see a single unified API in the documentation rather than having to look in two packages.
The HTML documentation also includes documentation comments from `LaunchDarkly.CommonSdk`. These are included automatically
when the documentation is built on release, so that developers can see a single unified API in the documentation rather
than having to look in two packages.

The `docs-src` subdirectory contains additional Markdown content that is included in the documentation build, as follows:

* `namespaces/<Fully.Qualified.Name.Of.Namespace>.md`: A file that is used as the description of a specific namespace. The first line is the summary, which will appear on both the landing page and the API page for the namespace; the rest of the file is the full description, which will appear on the API page for the namespace.
* `namespaces/<Fully.Qualified.Name.Of.Namespace>.md`: A file that is used as the description of a specific namespace.
* The first line is the summary, which will appear on both the landing page and the API page for the namespace; the rest
* of the file is the full description, which will appear on the API page for the namespace.

Markdown text can include hyperlinks to namespaces, types, etc. using the syntax `<xref:Fully.Qualified.Name.Of.Thing>`.
20 changes: 15 additions & 5 deletions pkgs/sdk/server/docs-src/namespaces/LaunchDarkly.Sdk.Json.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
Helper classes and methods for interoperability with JSON.

The NuGet package containing these types is [`LaunchDarkly.CommonSdk`](https://www.nuget.org/packages/LaunchDarkly.CommonSdk). Normally you should not need to reference that package directly; it is loaded automatically as a dependency of the main SDK package.
The NuGet package containing these types is [`LaunchDarkly.CommonSdk`](https://www.nuget.org/packages/LaunchDarkly.CommonSdk). Normally you should not need to reference
that package directly; it is loaded automatically as a dependency of the main SDK package.

Any LaunchDarkly SDK type that has the marker interface <xref:LaunchDarkly.Sdk.Json.IJsonSerializable> has a canonical JSON encoding that is consistent across all LaunchDarkly SDKs. There are three ways to convert any such type to or from JSON:
Any LaunchDarkly SDK type that has the marker interface <xref:LaunchDarkly.Sdk.Json.IJsonSerializable> has a canonical
JSON encoding that is consistent across all LaunchDarkly SDKs. There are three ways to convert any such type to or from JSON:

* When using the `System.Text.Json` API, these types already have the necessary attributes to behave correctly.
* You may use the <xref:LaunchDarkly.Sdk.Json.LdJsonSerialization> methods <xref:LaunchDarkly.Sdk.Json.LdJsonSerialization.SerializeObject``1(``0)> and <xref:LaunchDarkly.Sdk.Json.LdJsonSerialization.DeserializeObject``1(System.String)> to convert to or from a JSON-encoded string.
* When using the <xref:System.Text.Json> API, these types already have the necessary attributes to behave correctly.
* You may use the <xref:LaunchDarkly.Sdk.Json.LdJsonSerialization> methods
* <xref:LaunchDarkly.Sdk.Json.LdJsonSerialization.SerializeObject``1(``0)> and
* <xref:LaunchDarkly.Sdk.Json.LdJsonSerialization.DeserializeObject``1(System.String)> to convert to or from a
* JSON-encoded string.

Earlier versions of the LaunchDarkly SDKs used `Newtonsoft.Json` for JSON serialization, but current versions have no such third-party dependency. Therefore, these types will not work correctly with the reflection-based `JsonConvert` methods in `Newtonsoft.Json` without some extra logic. There is an add-on package, [`LaunchDarkly.CommonSdk.JsonNet`](https://github.com/launchdarkly/dotnet-sdk-common/tree/main/src/LaunchDarkly.CommonSdk.JsonNet), that provides an adapter to make this work; alternatively, you can call <xref:LaunchDarkly.Sdk.Json.LdJsonSerialization.SerializeObject``1(``0)> and put the resulting JSON output into a `Newtonsoft.Json.Linq.JRaw` value.
Earlier versions of the LaunchDarkly SDKs used `Newtonsoft.Json` for JSON serialization, but current versions have no
such third-party dependency. Therefore, these types will not work correctly with the reflection-based `JsonConvert`
methods in `Newtonsoft.Json` without some extra logic. There is an add-on package, [`LaunchDarkly.CommonSdk.JsonNet`](https://github.com/launchdarkly/dotnet-sdk-common/tree/main/src/LaunchDarkly.CommonSdk.JsonNet),
that provides an adapter to make this work; alternatively, you can call
<xref:LaunchDarkly.Sdk.Json.LdJsonSerialization.SerializeObject``1(``0)> and put the resulting JSON output into a
`Newtonsoft.Json.Linq.JRaw` value.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Tools for configuring how the SDK connects to LaunchDarkly, or to other software components.

This package contains the configuration builders for standard SDK components such as <xref:LaunchDarkly.Sdk.Server.Integrations.StreamingDataSourceBuilder>; the <xref:LaunchDarkly.Sdk.Server.Integrations.PersistentDataStoreBuilder> builder for use with database integrations (the specific database integrations themselves are provided by add-on libraries); and the test fixtures <xref:LaunchDarkly.Sdk.Server.Integrations.FileData> and <xref:LaunchDarkly.Sdk.Server.Integrations.TestData>.
This package contains the configuration builders for standard SDK components such as
<xref:LaunchDarkly.Sdk.Server.Integrations.StreamingDataSourceBuilder>; the
<xref:LaunchDarkly.Sdk.Server.Integrations.PersistentDataStoreBuilder> builder for use with database integrations
(the specific database integrations themselves are provided by add-on libraries); and the test fixtures
<xref:LaunchDarkly.Sdk.Server.Integrations.FileData> and <xref:LaunchDarkly.Sdk.Server.Integrations.TestData>.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ Interfaces and types that are part of the public API, but not needed for basic u

Types in this namespace include:

* <xref:LaunchDarkly.Sdk.Server.Interfaces.ILdClient>, which allows the SDK client to be referenced via an interface rather than the concrete type <xref:LaunchDarkly.Sdk.Server.LdClient> (if for instance you want to create a mock implementation for testing).
* Types like <xref:LaunchDarkly.Sdk.Server.Interfaces.IFlagTracker> that provide a facade for some part of the SDK API; these are returned by properties like <xref:LaunchDarkly.Sdk.Server.Interfaces.ILdClient.FlagTracker>.
* <xref:LaunchDarkly.Sdk.Server.Interfaces.ILdClient>, which allows the SDK client to be referenced via an interface
rather than the concrete type <xref:LaunchDarkly.Sdk.Server.LdClient> (if for instance you want to create a mock implementation for testing).
* Types like <xref:LaunchDarkly.Sdk.Server.Interfaces.IFlagTracker> that provide a facade for some part of the SDK API;
these are returned by properties like <xref:LaunchDarkly.Sdk.Server.Interfaces.ILdClient.FlagTracker>.
* Concrete types that are used as parameters within these interfaces, like <xref:LaunchDarkly.Sdk.Server.Interfaces.FlagChangeEvent>
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Interfaces for implementation of custom LaunchDarkly components.

Most applications will not need to refer to these types. You will use them if you are creating a plugin component, such as a database integration. They are also used as interfaces for the built-in SDK components, so that plugin components can be used interchangeably with those: for instance, the configuration method <xref LaunchDarkly.Sdk.Server.ConfigurationBuilder.DataStore> references <xref LaunchDarkly.Sdk.Server.Subsystems.IDataStore> as an abstraction for the data store component.
Most applications will not need to refer to these types. You will use them if you are creating a plugin component, such
as a database integration. They are also used as interfaces for the built-in SDK components, so that plugin components
can be used interchangeably with those: for instance, the configuration method
<xref:LaunchDarkly.Sdk.Server.ConfigurationBuilder.DataStore(LaunchDarkly.Sdk.Server.Subsystems.IComponentConfigurer{LaunchDarkly.Sdk.Server.Subsystems.IDataStore})>
references <xref:LaunchDarkly.Sdk.Server.Subsystems.IDataStore> as an abstraction for the data store component.

The namespace also includes concrete types that are used as parameters within these interfaces.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
The main namespace for the LaunchDarkly server-side .NET SDK.

You will most often use **<xref:LaunchDarkly.Sdk.Server.LdClient>** (the SDK client) and **<xref:LaunchDarkly.Sdk.Server.Configuration>** (configuration options for the client), as well as the **<xref:LaunchDarkly.Sdk.Context>** type from <xref:LaunchDarkly.Sdk>.
You will most often use <xref:LaunchDarkly.Sdk.Server.LdClient> (the SDK client) and
<xref:LaunchDarkly.Sdk.Server.Configuration> (configuration options for the client), as well as
the <xref:LaunchDarkly.Sdk.Context> type from <xref:LaunchDarkly.Sdk>.
6 changes: 4 additions & 2 deletions pkgs/sdk/server/docs-src/namespaces/LaunchDarkly.Sdk.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
The base namespace for all LaunchDarkly .NET-based SDKs, containing common types.

Types in this namespace are part of the overall LaunchDarkly model, shared by both server-side and client-side SDKs. The one you will use most often is **<xref:LaunchDarkly.Sdk.Context>**.
Types in this namespace are part of the overall LaunchDarkly model, shared by both server-side and client-side SDKs.
The one you will use most often is <xref:LaunchDarkly.Sdk.Context>.

The NuGet package containing these types is [`LaunchDarkly.CommonSdk`](https://www.nuget.org/packages/LaunchDarkly.CommonSdk). Normally you should not need to reference that package directly; it is loaded automatically as a dependency of the main SDK package.
The NuGet package containing these types is [`LaunchDarkly.CommonSdk`](https://www.nuget.org/packages/LaunchDarkly.CommonSdk). Normally you should not need to reference
that package directly; it is loaded automatically as a dependency of the main SDK package.
32 changes: 32 additions & 0 deletions pkgs/sdk/server/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
_layout: landing
---

# LaunchDarkly Server-Side SDK for .NET

For first time users, visit our [LaunchDarkly Docs](https://docs.launchdarkly.com/sdk/server-side/dotnet) page.
Within these docs, the <xref:LaunchDarkly.Sdk.Server.LdClient> and the <xref:LaunchDarkly.Sdk.ContextBuilder> are good
starting points to explore from.


This site contains the full API reference for the [`LaunchDarkly.ServerSdk`](https://www.nuget.org/packages/LaunchDarkly.ServerSdk)
package, as well as the `LaunchDarkly.CommonSdk` package that is included automatically as a dependency of the SDK.

For source code, see the [GitHub repository](https://github.com/launchdarkly/dotnet-server-sdk).
The [developer notes](https://github.com/launchdarkly/dotnet-server-sdk/blob/main/CONTRIBUTING.md) there include links
to other repositories used in the SDK.


## Namespaces

**[LaunchDarkly.Sdk](docs-src/namespaces/LaunchDarkly.Sdk.md):** The base namespace for all LaunchDarkly .NET-based SDKs, containing common types.

**[LaunchDarkly.Sdk.Server](docs-src/namespaces/LaunchDarkly.Sdk.Server.md):** The main namespace for the LaunchDarkly server-side .NET SDK.

**[LaunchDarkly.Sdk.Json](docs-src/namespaces/LaunchDarkly.Sdk.Json.md):** Helper classes and methods for interoperability with JSON.

**[LaunchDarkly.Sdk.Server.Integrations](docs-src/namespaces/LaunchDarkly.Sdk.Server.Integrations.md):** Tools for configuring how the SDK connects to LaunchDarkly, or to other software components.

**[LaunchDarkly.Sdk.Server.Interfaces](docs-src/namespaces/LaunchDarkly.Sdk.Server.Interfaces.md):** Interfaces and types that are part of the public API, but not needed for basic use of the SDK.

**[LaunchDarkly.Sdk.Server.Subsystem](docs-src/namespaces/LaunchDarkly.Sdk.Server.Subsystems.md):** Interfaces for implementation of custom LaunchDarkly components.
13 changes: 13 additions & 0 deletions pkgs/telemetry/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
_layout: landing
---

# LaunchDarkly Server-Side SDK for .NET: Telemetry

This package contains telemetry components for the .NET Server-Side SDK. It is a separate package from the main SDK so
that telemetry related changes will not impact the base SDK.

To get started, check out the documentation for [TracingHook](api/LaunchDarkly.Sdk.Server.Telemetry.TracingHook.yml).

This class can be used to add custom tracing to the SDK via the `System.Diagnostics` API, for usage with with compatible
systems like [OpenTelemetry](https://opentelemetry.io/docs/languages/net/).
7 changes: 5 additions & 2 deletions pkgs/telemetry/src/Telemetry/TracingHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ namespace LaunchDarkly.Sdk.Server.Telemetry
using SeriesData = ImmutableDictionary<string, object>;

/// <summary>
/// TracingHookBuilder creates a <see cref="TracingHook"/>s.
/// TracingHookBuilder creates a <see cref="TracingHook"/>. The hook can be passed into the SDK's Hook configuration
/// builder <see cref="ConfigurationBuilder.Hooks"/>. To create a TracingHook from a builder, call <see cref="Build"/>.
/// </summary>
public class TracingHookBuilder
{
Expand Down Expand Up @@ -53,7 +54,7 @@ public TracingHookBuilder IncludeVariant(bool includeVariant = true)
/// <summary>
/// Builds the <see cref="TracingHook"/> with the configured options.
///
/// The hook may be passed into the SDK's Hook configuration as-is.
/// The hook may be passed into <see cref="ConfigurationBuilder.Hooks"/>.
/// </summary>
/// <returns>the new hook</returns>
public TracingHook Build()
Expand All @@ -65,6 +66,8 @@ public TracingHook Build()
/// <summary>
/// TracingHook is a <see cref="Hook"/> that adds tracing capabilities to the LaunchDarkly SDK for feature flag
/// evaluations.
///
/// To create a TracingHook, see <see cref="TracingHookBuilder"/>.
/// </summary>
public class TracingHook : Hook
{
Expand Down

0 comments on commit e5006cf

Please sign in to comment.