Git Product home page Git Product logo

nosinovacao / name-sdk Goto Github PK

View Code? Open in Web Editor NEW
14.0 6.0 4.0 294 KB

A dependencies management library designed to expose and access dependencies information.

License: BSD 3-Clause "New" or "Revised" License

C# 81.78% PowerShell 1.01% Shell 1.31% Pascal 0.31% HTML 15.50% Dockerfile 0.09%
csharp library dependencies microservices self-contained-system expose asp net-core net-framework cross-platform

name-sdk's Introduction

NAME: Self-Contained Dependencies Management

Travis Build Status AppVeyor Build status

NAME is a service dependencies management library designed to expose and access services information, written in C#.

Its goal is to make it easier and simpler to detect service dependencies problems in a world where there are more and more services per application. It provides human and machine friendly dependencies information without the need for external tools.

Main Features

  • Self-contained
  • Developer friendly service dependencies definition
  • Human and machine readable service dependencies status
  • Deep dependencies health checks
  • Third-party service dependencies checks
  • Support for optional central registration
  • .Net Core and .NET 4.5+ compatible

Getting Started

Installing on ASP.NET Web API

  1. Install the Nuget Package
    Install-Package NAME.WebApi

The configuration file is present in App_Start/NAMEConfig.cs and the dependencies definition file is dependencies.json.

  1. Start the application and access the /manifest endpoint. It should show the dependencies state.

Installing on ASP.NET Core

  1. Install the NuGet package
    Install-Package NAME.AspNetCore
  1. Add the NAME middleware in the Configure method of your Startup.cs file.
// NAME middleware should be registered first so that the custom
// header is set before any other middleware has a chance to 
// send a response.
app.UseNAME(config =>
{
    Assembly a = typeof(Startup).GetTypeInfo().Assembly;
    config.APIName = a.GetName().Name;
    config.APIVersion = a.GetName().Version.ToString();
    // Comment the next line if you don't use the default Asp.Net Core IConfiguration interface.
    config.Configuration = Configuration;
});
  1. Create the dependencies.json file at the root of the project, the following example is a good starting point.
{
  "$schema": "https://raw.githubusercontent.com/nosinovacao/name-sdk/schema-v1/name.dependencies.v1.jschema",
  "infrastructure_dependencies": [
    {
      "os_name": "debian",
      "type": "OperatingSystem",
      "min_version": "8",
      "max_version": "*"
    }
  ],
  "service_dependencies": [
    {
      "name": "Internal Service",
      "min_version": "1.2.53",
      "max_version": "1.8",
      "connection_string": {
        "locator": "IConfiguration",
        "key": "ConnectionStrings:InternalServiceUri"
      }
    }
  ]
}
  1. Start the application and access the /manifest endpoint. It should show the dependencies state.

Non-Web Applications

For applications without a web server we created a SelfHost solution. You can read how to install NAME on those applications at Using NAME On Non Web Applications.

Documentation

See the Wiki for full documentation, examples, operational details and other information.

Building and testing

We define our build using Cake, this allows us to define a common ground for developers on different operating systems, but it requires .Net 4.5 or Mono 4.2.3, so make sure you have those dependencies setup.

Bootstrap scripts are provided for both Windows and Linux environments. Keep in mind that not all tests will run on Linux, because some projects are targeting .NET 4.5+.

To build and run unit tests on Windows execute the command:

powershell ./build.ps1

To build and run unit tests on Linux execute the command:

./build.sh

Contributing

We really appreciate your interest in contributing to NAME. 👍

All we ask is that you follow some simple guidelines, so please read the CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.

Thank you, contributors!

License

Copyright © NOS Inovação.

This project is licensed under the BSD 3-Clause License - see the LICENSE file for details

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.