Structr
  • Welcome
  • Utilities
    • Abstractions
      • Check
      • Ensure
      • Money
      • HierarchyId
      • Providers
        • SequentialGuidProvider
      • Extensions
        • DateTime
        • Dictionary
        • DirectoryInfo
        • Enumerable
        • Enum
        • Expression
        • Int
        • Long
        • MemberInfo
        • Object
        • Queryable
        • ServiceCollection
        • String
        • Type
      • Helpers
        • AsyncHelper
        • BindHelper
      • JsonConverters
        • DateOnly
        • TimeOnly
        • StringNumber
    • Collections
      • AutoMapper extensions
    • IO
      • FileHelper
      • MimeTypeHelper
      • PathHelper
      • SequentialFileName
    • Configuration
      • Providers
        • JSON-file
        • XML-file
        • In-Memory
        • Consul
      • Get settings
      • Set settings
      • Customization
    • Email
      • Razor
    • Navigation
      • Menu
      • Breadcrumbs
    • Security
  • Domain
    • Domain
      • Entities
      • Value objects
  • Data Access
    • Entity Framework Core
    • Entity Framework 6
  • Use Cases
    • Operations
      • Filtering
      • Decoration
    • Notices
    • Validation
    • Specifications
    • Stateflows
      • StateMachine
      • Configurations
  • Presentation
    • ASP.NET Core
      • Client
      • Http
      • JavaScript
      • Json
      • Mvc
      • Referrer
      • Rewrite
      • Routing
      • TagHelpers
      • Validation
Powered by GitBook
On this page
  • Installation
  • Setup

Was this helpful?

Edit on GitHub
  1. Utilities
  2. Configuration
  3. Providers

Consul

PreviousIn-MemoryNextGet settings

Last updated 2 years ago

Was this helpful?

ConsulSettingsProvider provides functionality of storing settings in Consul KV store.

Installation

Consul settings provider package is available on .

dotnet add package Structr.Configuration.Consul

Setup

Create settings class.

public class SmtpEmailSettings
{
    public string Host { get; set; }
    public int Port { get; set; }
}

Setup Consul settings provider:

services.AddConfiguration()
    .AddConsul<SmtpEmailSettings>("consul_key", new ConsulClient(options => {
        options.Address = new Uri("http://localhost:8500"); // Base URL to Consul KV store.
    }));
NuGet