├── scripts
├── after-success.sh
├── dotnet-build.sh
├── dotnet-test.sh
├── dotnet-publish.sh
├── nginx.config
├── docker-compose.yaml
├── docker-compose-elkx.yaml
├── docker-publish-travis.sh
└── docker-publish-pipelines.sh
├── src
├── Fibon.Service
│ ├── ICalculator.cs
│ ├── Dockerfile
│ ├── Framework
│ │ ├── RabbitMqOptions.cs
│ │ └── SerilogOptions.cs
│ ├── Dockerfile.development
│ ├── Dockerfile.production
│ ├── Controllers
│ │ └── HomeController.cs
│ ├── SerilogOptions.cs
│ ├── Fast.cs
│ ├── Program.cs
│ ├── Handlers
│ │ └── CalculateValueHandler.cs
│ ├── appsettings.docker.json
│ ├── appsettings.json
│ ├── appsettings.development.json
│ ├── appsettings.production.json
│ ├── Fibon.Service.csproj
│ └── Startup.cs
├── Fibon.Messages
│ ├── Commands
│ │ ├── ICommand.cs
│ │ ├── CalculateValue.cs
│ │ └── ICommandHandler.cs
│ ├── Fibon.Messages.csproj
│ └── Events
│ │ ├── IEvent.cs
│ │ ├── ValueCalculated.cs
│ │ └── IEventHandler.cs
└── Fibon.Api
│ ├── Dockerfile
│ ├── Framework
│ ├── RabbitMqOptions.cs
│ └── SerilogOptions.cs
│ ├── Dockerfile.production
│ ├── Dockerfile.development
│ ├── Controllers
│ ├── HomeController.cs
│ └── FibonacciController.cs
│ ├── Handlers
│ └── ValueCalculatedHandler.cs
│ ├── IRepository.cs
│ ├── Program.cs
│ ├── appsettings.docker.json
│ ├── appsettings.json
│ ├── appsettings.development.json
│ ├── appsettings.production.json
│ ├── Fibon.Api.csproj
│ └── Startup.cs
├── .travis.yml
├── tests
└── Fibon.Tests
│ ├── FibTests.cs
│ └── Fibon.Tests.csproj
├── LICENSE
├── bitbucket-pipelines.yml
├── Fibon.sln
└── .gitignore
/scripts/after-success.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | echo "Hooray! :)"
--------------------------------------------------------------------------------
/scripts/dotnet-build.sh:
--------------------------------------------------------------------------------
1 | dotnet restore
2 | dotnet build
--------------------------------------------------------------------------------
/scripts/dotnet-test.sh:
--------------------------------------------------------------------------------
1 | cd tests/Fibon.Tests
2 | dotnet test
--------------------------------------------------------------------------------
/scripts/dotnet-publish.sh:
--------------------------------------------------------------------------------
1 | dotnet publish ./src/Fibon.Api -c Release -o ./bin/Docker
2 | dotnet publish ./src/Fibon.Service -c Release -o ./bin/Docker
--------------------------------------------------------------------------------
/src/Fibon.Service/ICalculator.cs:
--------------------------------------------------------------------------------
1 | namespace Fibon.Service
2 | {
3 | public interface ICalculator
4 | {
5 | int Fib(int n);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Fibon.Messages/Commands/ICommand.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Fibon.Messages.Commands
4 | {
5 | public interface ICommand
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Fibon.Api/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM microsoft/dotnet:2.0.0-runtime
2 | WORKDIR /dotnetapp
3 | COPY ./bin/Docker .
4 | ENV ASPNETCORE_ENVIRONMENT docker
5 | ENTRYPOINT dotnet Fibon.Api.dll --urls "http://*:5000"
--------------------------------------------------------------------------------
/src/Fibon.Messages/Commands/CalculateValue.cs:
--------------------------------------------------------------------------------
1 | namespace Fibon.Messages.Commands
2 | {
3 | public class CalculateValue : ICommand
4 | {
5 | public int Number { get; set; }
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Fibon.Api/Framework/RabbitMqOptions.cs:
--------------------------------------------------------------------------------
1 | using RawRabbit.Configuration;
2 |
3 | namespace Fibon.Api.Framework
4 | {
5 | public class RabbitMqOptions : RawRabbitConfiguration
6 | {
7 | }
8 | }
--------------------------------------------------------------------------------
/src/Fibon.Messages/Fibon.Messages.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Fibon.Service/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM microsoft/dotnet:2.0.0-runtime
2 | WORKDIR /dotnetapp
3 | COPY ./bin/Docker .
4 | ENV ASPNETCORE_ENVIRONMENT docker
5 | ENTRYPOINT dotnet Fibon.Service.dll --urls "http://*:5050"
--------------------------------------------------------------------------------
/src/Fibon.Service/Framework/RabbitMqOptions.cs:
--------------------------------------------------------------------------------
1 | using RawRabbit.Configuration;
2 |
3 | namespace Fibon.Service.Framework
4 | {
5 | public class RabbitMqOptions : RawRabbitConfiguration
6 | {
7 | }
8 | }
--------------------------------------------------------------------------------
/src/Fibon.Api/Dockerfile.production:
--------------------------------------------------------------------------------
1 | FROM microsoft/dotnet:2.0.0-runtime
2 | WORKDIR /dotnetapp
3 | COPY ./bin/Docker .
4 | ENV ASPNETCORE_ENVIRONMENT production
5 | ENTRYPOINT dotnet Fibon.Api.dll --urls "http://*:5000"
--------------------------------------------------------------------------------
/src/Fibon.Messages/Events/IEvent.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Fibon.Messages.Events
4 | {
5 | //Marker interface
6 | public interface IEvent
7 | {
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Fibon.Api/Dockerfile.development:
--------------------------------------------------------------------------------
1 | FROM microsoft/dotnet:2.0.0-runtime
2 | WORKDIR /dotnetapp
3 | COPY ./bin/Docker .
4 | ENV ASPNETCORE_ENVIRONMENT development
5 | ENTRYPOINT dotnet Fibon.Api.dll --urls "http://*:5000"
--------------------------------------------------------------------------------
/src/Fibon.Service/Dockerfile.development:
--------------------------------------------------------------------------------
1 | FROM microsoft/dotnet:2.0.0-runtime
2 | WORKDIR /dotnetapp
3 | COPY ./bin/Docker .
4 | ENV ASPNETCORE_ENVIRONMENT development
5 | ENTRYPOINT dotnet Fibon.Service.dll --urls "http://*:5050"
--------------------------------------------------------------------------------
/src/Fibon.Service/Dockerfile.production:
--------------------------------------------------------------------------------
1 | FROM microsoft/dotnet:2.0.0-runtime
2 | WORKDIR /dotnetapp
3 | COPY ./bin/Docker .
4 | ENV ASPNETCORE_ENVIRONMENT production
5 | ENTRYPOINT dotnet Fibon.Service.dll --urls "http://*:5050"
--------------------------------------------------------------------------------
/src/Fibon.Messages/Events/ValueCalculated.cs:
--------------------------------------------------------------------------------
1 | namespace Fibon.Messages.Events
2 | {
3 | public class ValueCalculated : IEvent
4 | {
5 | public int Number { get; set; }
6 | public int Result { get; set; }
7 | }
8 | }
--------------------------------------------------------------------------------
/src/Fibon.Messages/Events/IEventHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Fibon.Messages.Events
4 | {
5 | public interface IEventHandler where T : IEvent
6 | {
7 | Task HandleAsync(T @event);
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Fibon.Messages/Commands/ICommandHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Fibon.Messages.Commands
4 | {
5 | public interface ICommandHandler where T : ICommand
6 | {
7 | Task HandleAsync(T command);
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Fibon.Api/Controllers/HomeController.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 |
3 | namespace Fibon.Api.Controllers
4 | {
5 | [Route("")]
6 | public class HomeController : Controller
7 | {
8 | [HttpGet("")]
9 | public IActionResult Get()
10 | => Content("Hello from Fibon API!");
11 | }
12 | }
--------------------------------------------------------------------------------
/scripts/nginx.config:
--------------------------------------------------------------------------------
1 | server {
2 | listen 80;
3 |
4 | location / {
5 | proxy_pass http://localhost:5000;
6 | proxy_set_header Upgrade $http_upgrade;
7 | proxy_set_header Connection keep-alive;
8 | proxy_set_header Host $host;
9 | proxy_cache_bypass $http_upgrade;
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Fibon.Service/Controllers/HomeController.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 |
3 | namespace Fibon.Service.Controllers
4 | {
5 | [Route("")]
6 | public class HomeController : Controller
7 | {
8 | [HttpGet("")]
9 | public IActionResult Get()
10 | => Content("Hello from Fibon Service!");
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Fibon.Service/SerilogOptions.cs:
--------------------------------------------------------------------------------
1 | namespace Fibon.Api.Framework
2 | {
3 | public class SerilogOptions
4 | {
5 | public string Level { get; set; }
6 | public string ApiUrl { get; set; }
7 | public bool UseBasicAuth { get; set ;}
8 | public string Username { get; set; }
9 | public string Password { get; set; }
10 | public string IndexFormat { get; set; }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Fibon.Api/Framework/SerilogOptions.cs:
--------------------------------------------------------------------------------
1 | namespace Fibon.Api.Framework
2 | {
3 | public class SerilogOptions
4 | {
5 | public string Level { get; set; }
6 | public string ApiUrl { get; set; }
7 | public bool UseBasicAuth { get; set ;}
8 | public string Username { get; set; }
9 | public string Password { get; set; }
10 | public string IndexFormat { get; set; }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Fibon.Service/Framework/SerilogOptions.cs:
--------------------------------------------------------------------------------
1 | namespace Fibon.Service.Framework
2 | {
3 | public class SerilogOptions
4 | {
5 | public string Level { get; set; }
6 | public string ApiUrl { get; set; }
7 | public bool UseBasicAuth { get; set ;}
8 | public string Username { get; set; }
9 | public string Password { get; set; }
10 | public string IndexFormat { get; set; }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Fibon.Service/Fast.cs:
--------------------------------------------------------------------------------
1 | namespace Fibon.Service
2 | {
3 | public class Fast : ICalculator
4 | {
5 | public int Fib(int n)
6 | {
7 | int a = 0;
8 | int b = 1;
9 | for (int i = 0; i < n; i++)
10 | {
11 | int temp = a;
12 | a = b;
13 | b = temp + b;
14 | }
15 |
16 | return a;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: csharp
2 | dist: trusty
3 | sudo: required
4 | mono: none
5 | dotnet: 2.0.0
6 | branches:
7 | only:
8 | - master
9 | - develop
10 | before_script:
11 | - chmod -R a+x scripts
12 | script:
13 | - ./scripts/dotnet-build.sh
14 | - ./scripts/dotnet-test.sh
15 | - ./scripts/dotnet-publish.sh
16 | - ./scripts/docker-publish-travis.sh
17 | after_success:
18 | - ./scripts/after-success.sh
19 | notifications:
20 | email:
21 | on_success: never
22 | on_failure: always
--------------------------------------------------------------------------------
/scripts/docker-compose.yaml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | services:
4 | start-dependencies:
5 | image: dadarek/wait-for-dependencies
6 | depends_on:
7 | - rabbitmq
8 | command: rabbitmq:5672
9 |
10 | fibon-api:
11 | image: fibon.api
12 | links:
13 | - rabbitmq
14 | ports:
15 | - '5000:5000'
16 |
17 | fibon-service:
18 | image: fibon.service
19 | links:
20 | - rabbitmq
21 | ports:
22 | - '5050:5050'
23 |
24 | rabbitmq:
25 | image: rabbitmq:latest
26 | ports:
27 | - '5672:5672'
--------------------------------------------------------------------------------
/tests/Fibon.Tests/FibTests.cs:
--------------------------------------------------------------------------------
1 | using Fibon.Service;
2 | using Xunit;
3 |
4 | namespace Fibon.Tests
5 | {
6 | public class FibTests
7 | {
8 | [Theory]
9 | [InlineData(0, 0)]
10 | [InlineData(1, 1)]
11 | [InlineData(2, 1)]
12 | [InlineData(7, 13)]
13 | public void Fib_ReturnsCorrectValues(int number, int expectedResults)
14 | {
15 | ICalculator calc = new Fast();
16 | int result = calc.Fib(number);
17 |
18 | Assert.Equal(expectedResults, result);
19 | }
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/tests/Fibon.Tests/Fibon.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/Fibon.Api/Handlers/ValueCalculatedHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Fibon.Messages;
3 | using Fibon.Messages.Events;
4 |
5 | namespace Fibon.Api.Handlers
6 | {
7 | public class ValueCalculatedHandler : IEventHandler
8 | {
9 | private readonly IRepository _repository;
10 |
11 | public ValueCalculatedHandler(IRepository repository)
12 | {
13 | _repository = repository;
14 | }
15 |
16 | public async Task HandleAsync(ValueCalculated @event)
17 | {
18 | _repository.Insert(number: @event.Number, result: @event.Result);
19 | await Task.CompletedTask;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Fibon.Api/IRepository.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Fibon.Api
4 | {
5 | public interface IRepository
6 | {
7 | int? Get(int number);
8 | void Insert(int number, int result);
9 | }
10 |
11 | public class InMemoryRepository : IRepository
12 | {
13 | private readonly Dictionary _results = new Dictionary();
14 |
15 | public int? Get(int number)
16 | {
17 | int result;
18 | if (_results.TryGetValue(number, out result))
19 | {
20 | return result;
21 | }
22 |
23 | return null;
24 | }
25 |
26 | public void Insert(int number, int result)
27 | {
28 | _results[number] = result;
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/scripts/docker-compose-elkx.yaml:
--------------------------------------------------------------------------------
1 | version: "2"
2 |
3 | services:
4 | start-dependencies:
5 | image: dadarek/wait-for-dependencies
6 | depends_on:
7 | - rabbitmq
8 | command: rabbitmq:5672
9 |
10 | fibon-api:
11 | image: fibon.api
12 | links:
13 | - rabbitmq
14 | - elkx
15 | ports:
16 | - '5000:5000'
17 |
18 | fibon-service:
19 | image: fibon.service
20 | links:
21 | - rabbitmq
22 | - elkx
23 | ports:
24 | - '5050:5050'
25 |
26 | rabbitmq:
27 | image: rabbitmq:latest
28 | ports:
29 | - '5672:5672'
30 |
31 | elkx:
32 | image: sebp/elkx:latest
33 | volumes:
34 | - elk-data:/var/lib/elasticsearch
35 | ports:
36 | - '5044:5044'
37 | - '5601:5601'
38 | - '9200:9200'
39 |
40 | volumes:
41 | elk-data:
42 | external: false
--------------------------------------------------------------------------------
/scripts/docker-publish-travis.sh:
--------------------------------------------------------------------------------
1 | DOCKER_ENV=''
2 | DOCKER_TAG=''
3 |
4 | case "$TRAVIS_BRANCH" in
5 | "master")
6 | DOCKER_ENV=production
7 | DOCKER_TAG=latest
8 | ;;
9 | "develop")
10 | DOCKER_ENV=development
11 | DOCKER_TAG=dev
12 | ;;
13 | esac
14 |
15 | docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
16 |
17 | docker build -f ./src/Fibon.Api/Dockerfile.$DOCKER_ENV -t fibon-api:$DOCKER_TAG ./src/Fibon.Api --no-cache
18 | docker build -f ./src/Fibon.Service/Dockerfile.$DOCKER_ENV -t fibon-service:$DOCKER_TAG ./src/Fibon.Service --no-cache
19 |
20 | docker tag fibon-api:$DOCKER_TAG $DOCKER_USERNAME/fibon-api:$DOCKER_TAG
21 | docker tag fibon-service:$DOCKER_TAG $DOCKER_USERNAME/fibon-service:$DOCKER_TAG
22 |
23 | docker push $DOCKER_USERNAME/fibon-api:$DOCKER_TAG
24 | docker push $DOCKER_USERNAME/fibon-service:$DOCKER_TAG
--------------------------------------------------------------------------------
/scripts/docker-publish-pipelines.sh:
--------------------------------------------------------------------------------
1 | DOCKER_ENV=''
2 | DOCKER_TAG=''
3 |
4 | case "$BITBUCKET_BRANCH" in
5 | "master")
6 | DOCKER_ENV=production
7 | DOCKER_TAG=latest
8 | ;;
9 | "develop")
10 | DOCKER_ENV=development
11 | DOCKER_TAG=dev
12 | ;;
13 | esac
14 |
15 | docker login $DOCKER_REGISTRY -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
16 |
17 | docker build -f ./src/Fibon.Api/Dockerfile.$DOCKER_ENV -t fibon-api:$DOCKER_TAG ./src/Fibon.Api --no-cache
18 | docker build -f ./src/Fibon.Service/Dockerfile.$DOCKER_ENV -t fibon-service:$DOCKER_TAG ./src/Fibon.Service --no-cache
19 |
20 | docker tag fibon-api:$DOCKER_TAG $DOCKER_REGISTRY/fibon-api:$DOCKER_TAG
21 | docker tag fibon-service:$DOCKER_TAG $DOCKER_REGISTRY/fibon-service:$DOCKER_TAG
22 |
23 | docker push $DOCKER_REGISTRY/fibon-api:$DOCKER_TAG
24 | docker push $DOCKER_REGISTRY/fibon-service:$DOCKER_TAG
--------------------------------------------------------------------------------
/src/Fibon.Api/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore;
7 | using Microsoft.AspNetCore.Builder;
8 | using Microsoft.AspNetCore.Hosting;
9 | using Microsoft.Extensions.Configuration;
10 |
11 | namespace Fibon.Api
12 | {
13 | public class Program
14 | {
15 | public static void Main(string[] args)
16 | {
17 | var config = new ConfigurationBuilder()
18 | .AddEnvironmentVariables()
19 | .AddCommandLine(args)
20 | .Build();
21 | WebHost.CreateDefaultBuilder(args)
22 | .UseConfiguration(config)
23 | .UseStartup()
24 | .Build()
25 | .Run();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Fibon.Service/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore;
7 | using Microsoft.AspNetCore.Builder;
8 | using Microsoft.AspNetCore.Hosting;
9 | using Microsoft.Extensions.Configuration;
10 |
11 | namespace Fibon.Service
12 | {
13 | public class Program
14 | {
15 | public static void Main(string[] args)
16 | {
17 | var config = new ConfigurationBuilder()
18 | .AddEnvironmentVariables()
19 | .AddCommandLine(args)
20 | .Build();
21 | WebHost.CreateDefaultBuilder(args)
22 | .UseConfiguration(config)
23 | .UseStartup()
24 | .Build()
25 | .Run();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Fibon.Service/Handlers/CalculateValueHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Fibon.Messages;
3 | using Fibon.Messages.Commands;
4 | using Fibon.Messages.Events;
5 | using RawRabbit;
6 |
7 | namespace Fibon.Service.Handlers
8 | {
9 | public class CalculateValueHandler : ICommandHandler
10 | {
11 | private readonly IBusClient _client;
12 | private readonly ICalculator _calculator;
13 |
14 | public CalculateValueHandler(IBusClient client, ICalculator calculator)
15 | {
16 | _client = client;
17 | _calculator = calculator;
18 | }
19 |
20 | public async Task HandleAsync(CalculateValue command)
21 | {
22 | int result = _calculator.Fib(command.Number);
23 |
24 | await _client.PublishAsync(new ValueCalculated
25 | {
26 | Number = command.Number,
27 | Result = result
28 | });
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Fibon.Api/appsettings.docker.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Warning"
6 | }
7 | },
8 | "rabbitmq": {
9 | "Username": "guest",
10 | "Password": "guest",
11 | "VirtualHost": "/",
12 | "Port": 5672,
13 | "Hostnames": [ "rabbitmq" ],
14 | "RequestTimeout": "00:00:10",
15 | "PublishConfirmTimeout": "00:00:01",
16 | "RecoveryInterval": "00:00:10",
17 | "PersistentDeliveryMode": true,
18 | "AutoCloseConnection": true,
19 | "AutomaticRecovery": true,
20 | "TopologyRecovery": true,
21 | "Exchange": {
22 | "Durable": true,
23 | "AutoDelete": true,
24 | "Type": "Topic"
25 | },
26 | "Queue": {
27 | "AutoDelete": true,
28 | "Durable": true,
29 | "Exclusive": true
30 | }
31 | },
32 | "serilog": {
33 | "level": "Debug",
34 | "indexFormat": "",
35 | "useBasicAuth": true,
36 | "apiUrl": "http://elkx:9200",
37 | "username": "elastic",
38 | "password": "changeme"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Fibon.Api/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Warning"
6 | }
7 | },
8 | "rabbitmq": {
9 | "Username": "guest",
10 | "Password": "guest",
11 | "VirtualHost": "/",
12 | "Port": 5672,
13 | "Hostnames": [ "localhost" ],
14 | "RequestTimeout": "00:00:10",
15 | "PublishConfirmTimeout": "00:00:01",
16 | "RecoveryInterval": "00:00:10",
17 | "PersistentDeliveryMode": true,
18 | "AutoCloseConnection": true,
19 | "AutomaticRecovery": true,
20 | "TopologyRecovery": true,
21 | "Exchange": {
22 | "Durable": true,
23 | "AutoDelete": true,
24 | "Type": "Topic"
25 | },
26 | "Queue": {
27 | "AutoDelete": true,
28 | "Durable": true,
29 | "Exclusive": true
30 | }
31 | },
32 | "serilog": {
33 | "level": "Debug",
34 | "indexFormat": "",
35 | "useBasicAuth": true,
36 | "apiUrl": "http://localhost:9200",
37 | "username": "elastic",
38 | "password": "changeme"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Fibon.Api/appsettings.development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Warning"
6 | }
7 | },
8 | "rabbitmq": {
9 | "Username": "guest",
10 | "Password": "guest",
11 | "VirtualHost": "/",
12 | "Port": 5672,
13 | "Hostnames": [ "rabbitmq" ],
14 | "RequestTimeout": "00:00:10",
15 | "PublishConfirmTimeout": "00:00:01",
16 | "RecoveryInterval": "00:00:10",
17 | "PersistentDeliveryMode": true,
18 | "AutoCloseConnection": true,
19 | "AutomaticRecovery": true,
20 | "TopologyRecovery": true,
21 | "Exchange": {
22 | "Durable": true,
23 | "AutoDelete": true,
24 | "Type": "Topic"
25 | },
26 | "Queue": {
27 | "AutoDelete": true,
28 | "Durable": true,
29 | "Exclusive": true
30 | }
31 | },
32 | "serilog": {
33 | "level": "Debug",
34 | "indexFormat": "",
35 | "useBasicAuth": true,
36 | "apiUrl": "http://elkx:9200",
37 | "username": "elastic",
38 | "password": "changeme"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Fibon.Api/appsettings.production.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Warning"
6 | }
7 | },
8 | "rabbitmq": {
9 | "Username": "guest",
10 | "Password": "guest",
11 | "VirtualHost": "/",
12 | "Port": 5672,
13 | "Hostnames": [ "rabbitmq" ],
14 | "RequestTimeout": "00:00:10",
15 | "PublishConfirmTimeout": "00:00:01",
16 | "RecoveryInterval": "00:00:10",
17 | "PersistentDeliveryMode": true,
18 | "AutoCloseConnection": true,
19 | "AutomaticRecovery": true,
20 | "TopologyRecovery": true,
21 | "Exchange": {
22 | "Durable": true,
23 | "AutoDelete": true,
24 | "Type": "Topic"
25 | },
26 | "Queue": {
27 | "AutoDelete": true,
28 | "Durable": true,
29 | "Exclusive": true
30 | }
31 | },
32 | "serilog": {
33 | "level": "Debug",
34 | "indexFormat": "",
35 | "useBasicAuth": true,
36 | "apiUrl": "http://elkx:9200",
37 | "username": "elastic",
38 | "password": "changeme"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Fibon.Service/appsettings.docker.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Warning"
6 | }
7 | },
8 | "rabbitmq": {
9 | "Username": "guest",
10 | "Password": "guest",
11 | "VirtualHost": "/",
12 | "Port": 5672,
13 | "Hostnames": [ "rabbitmq" ],
14 | "RequestTimeout": "00:00:10",
15 | "PublishConfirmTimeout": "00:00:01",
16 | "RecoveryInterval": "00:00:10",
17 | "PersistentDeliveryMode": true,
18 | "AutoCloseConnection": true,
19 | "AutomaticRecovery": true,
20 | "TopologyRecovery": true,
21 | "Exchange": {
22 | "Durable": true,
23 | "AutoDelete": true,
24 | "Type": "Topic"
25 | },
26 | "Queue": {
27 | "AutoDelete": true,
28 | "Durable": true,
29 | "Exclusive": true
30 | }
31 | },
32 | "serilog": {
33 | "level": "Debug",
34 | "indexFormat": "",
35 | "useBasicAuth": true,
36 | "apiUrl": "http://elkx:9200",
37 | "username": "elastic",
38 | "password": "changeme"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Fibon.Service/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Warning"
6 | }
7 | },
8 | "rabbitmq": {
9 | "Username": "guest",
10 | "Password": "guest",
11 | "VirtualHost": "/",
12 | "Port": 5672,
13 | "Hostnames": [ "localhost" ],
14 | "RequestTimeout": "00:00:10",
15 | "PublishConfirmTimeout": "00:00:01",
16 | "RecoveryInterval": "00:00:10",
17 | "PersistentDeliveryMode": true,
18 | "AutoCloseConnection": true,
19 | "AutomaticRecovery": true,
20 | "TopologyRecovery": true,
21 | "Exchange": {
22 | "Durable": true,
23 | "AutoDelete": true,
24 | "Type": "Topic"
25 | },
26 | "Queue": {
27 | "AutoDelete": true,
28 | "Durable": true,
29 | "Exclusive": true
30 | }
31 | },
32 | "serilog": {
33 | "level": "Debug",
34 | "indexFormat": "",
35 | "useBasicAuth": true,
36 | "apiUrl": "http://localhost:9200",
37 | "username": "elastic",
38 | "password": "changeme"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Fibon.Service/appsettings.development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Warning"
6 | }
7 | },
8 | "rabbitmq": {
9 | "Username": "guest",
10 | "Password": "guest",
11 | "VirtualHost": "/",
12 | "Port": 5672,
13 | "Hostnames": [ "rabbitmq" ],
14 | "RequestTimeout": "00:00:10",
15 | "PublishConfirmTimeout": "00:00:01",
16 | "RecoveryInterval": "00:00:10",
17 | "PersistentDeliveryMode": true,
18 | "AutoCloseConnection": true,
19 | "AutomaticRecovery": true,
20 | "TopologyRecovery": true,
21 | "Exchange": {
22 | "Durable": true,
23 | "AutoDelete": true,
24 | "Type": "Topic"
25 | },
26 | "Queue": {
27 | "AutoDelete": true,
28 | "Durable": true,
29 | "Exclusive": true
30 | }
31 | },
32 | "serilog": {
33 | "level": "Debug",
34 | "indexFormat": "",
35 | "useBasicAuth": true,
36 | "apiUrl": "http://elkx:9200",
37 | "username": "elastic",
38 | "password": "changeme"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Fibon.Service/appsettings.production.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Warning"
6 | }
7 | },
8 | "rabbitmq": {
9 | "Username": "guest",
10 | "Password": "guest",
11 | "VirtualHost": "/",
12 | "Port": 5672,
13 | "Hostnames": [ "rabbitmq" ],
14 | "RequestTimeout": "00:00:10",
15 | "PublishConfirmTimeout": "00:00:01",
16 | "RecoveryInterval": "00:00:10",
17 | "PersistentDeliveryMode": true,
18 | "AutoCloseConnection": true,
19 | "AutomaticRecovery": true,
20 | "TopologyRecovery": true,
21 | "Exchange": {
22 | "Durable": true,
23 | "AutoDelete": true,
24 | "Type": "Topic"
25 | },
26 | "Queue": {
27 | "AutoDelete": true,
28 | "Durable": true,
29 | "Exclusive": true
30 | }
31 | },
32 | "serilog": {
33 | "level": "Debug",
34 | "indexFormat": "",
35 | "useBasicAuth": true,
36 | "apiUrl": "http://elkx:9200",
37 | "username": "elastic",
38 | "password": "changeme"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Piotr Gankiewicz
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/bitbucket-pipelines.yml:
--------------------------------------------------------------------------------
1 | # This is a sample build configuration for .NET Core.
2 | # Check our guides at https://confluence.atlassian.com/x/5Q4SMw for more examples.
3 | # Only use spaces to indent your .yml configuration.
4 | # -----
5 | # You can specify a custom docker image from Docker Hub as your build environment.
6 | image: microsoft/dotnet:2.0.0-sdk
7 |
8 | options:
9 | docker: true
10 |
11 | pipelines:
12 | branches:
13 | master:
14 | - step:
15 | caches:
16 | - dotnetcore
17 | script:
18 | - export DOCKER_ENV=production
19 | - chmod -R a+x scripts
20 | - ./scripts/dotnet-build.sh
21 | - ./scripts/dotnet-test.sh
22 | - ./scripts/dotnet-publish.sh
23 | - ./scripts/docker-publish-pipelines.sh
24 | - ./scripts/after-success.sh
25 | develop:
26 | - step:
27 | caches:
28 | - dotnetcore
29 | script:
30 | - export DOCKER_ENV=development
31 | - chmod -R a+x scripts
32 | - ./scripts/dotnet-build.sh
33 | - ./scripts/dotnet-test.sh
34 | - ./scripts/dotnet-publish.sh
35 | - ./scripts/docker-publish-pipelines.sh
36 | - ./scripts/after-success.sh
--------------------------------------------------------------------------------
/src/Fibon.Api/Fibon.Api.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netcoreapp2.0
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/Fibon.Service/Fibon.Service.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netcoreapp2.0
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/Fibon.Api/Controllers/FibonacciController.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Fibon.Messages;
3 | using Fibon.Messages.Commands;
4 | using Microsoft.AspNetCore.Mvc;
5 | using RawRabbit;
6 |
7 | namespace Fibon.Api.Controllers
8 | {
9 | [Route("[controller]")]
10 | public class FibonacciController : Controller
11 | {
12 | private readonly IBusClient _client;
13 | private readonly IRepository _repository;
14 |
15 | public FibonacciController(IBusClient client,
16 | IRepository repository)
17 | {
18 | _client = client;
19 | _repository = repository;
20 | }
21 |
22 | [HttpGet("{number}")]
23 | public IActionResult Get(int number)
24 | {
25 | int? result = _repository.Get(number);
26 | if (result.HasValue)
27 | {
28 | return Content(result.ToString());
29 | }
30 |
31 | return Content("Not ready...");
32 | }
33 |
34 | [HttpPost("{number}")]
35 | public async Task Post(int number)
36 | {
37 | int? result = _repository.Get(number);
38 | if (!result.HasValue)
39 | {
40 | await _client.PublishAsync(new CalculateValue
41 | {
42 | Number = number
43 | });
44 | }
45 |
46 | return Accepted($"fibonacci/{number}", null);
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/Fibon.Service/Startup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Reflection;
5 | using System.Threading.Tasks;
6 | using Fibon.Messages;
7 | using Fibon.Messages.Commands;
8 | using Fibon.Service.Framework;
9 | using Fibon.Service.Handlers;
10 | using Microsoft.AspNetCore.Builder;
11 | using Microsoft.AspNetCore.Hosting;
12 | using Microsoft.Extensions.Configuration;
13 | using Microsoft.Extensions.DependencyInjection;
14 | using Microsoft.Extensions.Logging;
15 | using RawRabbit;
16 | using RawRabbit.Instantiation;
17 | using RawRabbit.Pipe;
18 | using Serilog;
19 | using Serilog.Events;
20 | using Serilog.Sinks.Elasticsearch;
21 |
22 | namespace Fibon.Service
23 | {
24 | public class Startup
25 | {
26 | public Startup(IHostingEnvironment env)
27 | {
28 | var builder = new ConfigurationBuilder()
29 | .SetBasePath(env.ContentRootPath)
30 | .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
31 | .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
32 | .AddEnvironmentVariables();
33 | Configuration = builder.Build();
34 | }
35 |
36 | public IConfigurationRoot Configuration { get; }
37 |
38 | // This method gets called by the runtime. Use this method to add services to the container.
39 | public void ConfigureServices(IServiceCollection services)
40 | {
41 | // Add framework services.
42 | var serilogOptions = new SerilogOptions();
43 | Configuration.GetSection("serilog").Bind(serilogOptions);
44 | services.AddSingleton(serilogOptions);
45 | services.AddLogging();
46 | services.AddMvc();
47 | ConfigureRabbitMq(services);
48 | }
49 |
50 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
51 | public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
52 | {
53 | loggerFactory.AddSerilog();
54 | var serilogOptions = app.ApplicationServices.GetService();
55 | var level = (LogEventLevel)Enum.Parse(typeof(LogEventLevel), serilogOptions.Level, true);
56 | Log.Logger = new LoggerConfiguration()
57 | .Enrich.FromLogContext()
58 | .MinimumLevel.Is(level)
59 | .WriteTo.Elasticsearch(
60 | new ElasticsearchSinkOptions(new Uri(serilogOptions.ApiUrl))
61 | {
62 | MinimumLogEventLevel = level,
63 | AutoRegisterTemplate = true,
64 | IndexFormat = string.IsNullOrWhiteSpace(serilogOptions.IndexFormat) ?
65 | "logstash-{0:yyyy.MM.dd}" :
66 | serilogOptions.IndexFormat,
67 | ModifyConnectionSettings = x =>
68 | serilogOptions.UseBasicAuth ?
69 | x.BasicAuthentication(serilogOptions.Username, serilogOptions.Password) :
70 | x
71 | })
72 | .CreateLogger();
73 |
74 | app.UseMvc();
75 | ConfigureRabbitMqSubscriptions(app);
76 | }
77 |
78 | private void ConfigureRabbitMqSubscriptions(IApplicationBuilder app)
79 | {
80 | IBusClient client = app.ApplicationServices.GetService();
81 | var handler = app.ApplicationServices.GetService>();
82 | client.SubscribeAsync(msg => handler.HandleAsync(msg),
83 | ctx => ctx.UseConsumerConfiguration(cfg =>
84 | cfg.FromDeclaredQueue(q => q.WithName(GetExchangeName()))));
85 | }
86 |
87 | private void ConfigureRabbitMq(IServiceCollection services)
88 | {
89 | var options = new RabbitMqOptions();
90 | var section = Configuration.GetSection("rabbitmq");
91 | section.Bind(options);
92 |
93 | var client = RawRabbitFactory.CreateSingleton(new RawRabbitOptions
94 | {
95 | ClientConfiguration = options
96 | });
97 | services.AddSingleton(_ => client);
98 | services.AddSingleton(_ => new Fast());
99 | services.AddTransient, CalculateValueHandler>();
100 | }
101 |
102 | private static string GetExchangeName(string name = null)
103 | => string.IsNullOrWhiteSpace(name)
104 | ? $"{Assembly.GetEntryAssembly().GetName()}/{typeof(T).Name}"
105 | : $"{name}/{typeof(T).Name}";
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/src/Fibon.Api/Startup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Reflection;
5 | using System.Threading.Tasks;
6 | using Fibon.Api.Framework;
7 | using Fibon.Api.Handlers;
8 | using Fibon.Messages;
9 | using Fibon.Messages.Events;
10 | using Microsoft.AspNetCore.Builder;
11 | using Microsoft.AspNetCore.Hosting;
12 | using Microsoft.Extensions.Configuration;
13 | using Microsoft.Extensions.DependencyInjection;
14 | using Microsoft.Extensions.Logging;
15 | using RawRabbit;
16 | using RawRabbit.Instantiation;
17 | using RawRabbit.Pipe;
18 | using Serilog;
19 | using Serilog.Events;
20 | using Serilog.Sinks.Elasticsearch;
21 |
22 | namespace Fibon.Api
23 | {
24 | public class Startup
25 | {
26 | public Startup(IHostingEnvironment env)
27 | {
28 | var builder = new ConfigurationBuilder()
29 | .SetBasePath(env.ContentRootPath)
30 | .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
31 | .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
32 | .AddEnvironmentVariables();
33 | Configuration = builder.Build();
34 | }
35 |
36 | public IConfigurationRoot Configuration { get; }
37 |
38 | // This method gets called by the runtime. Use this method to add services to the container.
39 | public void ConfigureServices(IServiceCollection services)
40 | {
41 | // Add framework services.
42 | var serilogOptions = new SerilogOptions();
43 | Configuration.GetSection("serilog").Bind(serilogOptions);
44 | services.AddSingleton(serilogOptions);
45 | services.AddLogging();
46 | services.AddMvc();
47 | services.AddSingleton(_ => new InMemoryRepository());
48 | ConfigureRabbitMq(services);
49 | //services.Configure(Configuration.GetSection("rabbitmq"));
50 | }
51 |
52 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
53 | public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
54 | {
55 | loggerFactory.AddSerilog();
56 | var serilogOptions = app.ApplicationServices.GetService();
57 | var level = (LogEventLevel)Enum.Parse(typeof(LogEventLevel), serilogOptions.Level, true);
58 | Log.Logger = new LoggerConfiguration()
59 | .Enrich.FromLogContext()
60 | .MinimumLevel.Is(level)
61 | .WriteTo.Elasticsearch(
62 | new ElasticsearchSinkOptions(new Uri(serilogOptions.ApiUrl))
63 | {
64 | MinimumLogEventLevel = level,
65 | AutoRegisterTemplate = true,
66 | IndexFormat = string.IsNullOrWhiteSpace(serilogOptions.IndexFormat) ?
67 | "logstash-{0:yyyy.MM.dd}" :
68 | serilogOptions.IndexFormat,
69 | ModifyConnectionSettings = x =>
70 | serilogOptions.UseBasicAuth ?
71 | x.BasicAuthentication(serilogOptions.Username, serilogOptions.Password) :
72 | x
73 | })
74 | .CreateLogger();
75 |
76 | app.UseMvc();
77 | ConfigureRabbitMqSubscriptions(app);
78 | }
79 |
80 | private void ConfigureRabbitMqSubscriptions(IApplicationBuilder app)
81 | {
82 | IBusClient client = app.ApplicationServices.GetService();
83 | var handler = app.ApplicationServices.GetService>();
84 | client.SubscribeAsync(msg => handler.HandleAsync(msg),
85 | ctx => ctx.UseConsumerConfiguration(cfg =>
86 | cfg.FromDeclaredQueue(q => q.WithName(GetExchangeName()))));
87 | }
88 | private void ConfigureRabbitMq(IServiceCollection services)
89 | {
90 | var options = new RabbitMqOptions();
91 | var section = Configuration.GetSection("rabbitmq");
92 | section.Bind(options);
93 |
94 | var client = RawRabbitFactory.CreateSingleton(new RawRabbitOptions
95 | {
96 | ClientConfiguration = options
97 | });
98 | services.AddSingleton(_ => client);
99 | services.AddScoped, ValueCalculatedHandler>();
100 | }
101 |
102 | private static string GetExchangeName(string name = null)
103 | => string.IsNullOrWhiteSpace(name)
104 | ? $"{Assembly.GetEntryAssembly().GetName()}/{typeof(T).Name}"
105 | : $"{name}/{typeof(T).Name}";
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/Fibon.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 12.00
2 | # Visual Studio 15
3 | VisualStudioVersion = 15.0.26430.15
4 | MinimumVisualStudioVersion = 15.0.26124.0
5 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{8A0DD8FC-4167-48D5-BAED-0EB6D158B8ED}"
6 | EndProject
7 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fibon.Api", "src\Fibon.Api\Fibon.Api.csproj", "{C4E4A5C3-D3CB-4E91-859E-D5ABDB42F6F5}"
8 | EndProject
9 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fibon.Service", "src\Fibon.Service\Fibon.Service.csproj", "{4DE01154-17A6-4B2A-8BD2-2B254764651E}"
10 | EndProject
11 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fibon.Messages", "src\Fibon.Messages\Fibon.Messages.csproj", "{26A631F8-11CF-48E6-99AE-909296B2772B}"
12 | EndProject
13 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{31FA2789-6CDB-4BA2-B390-ACECC0824CF4}"
14 | EndProject
15 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fibon.Tests", "tests\Fibon.Tests\Fibon.Tests.csproj", "{31F54862-1799-4191-A891-3C22D438EB2D}"
16 | EndProject
17 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{5869EEC9-E84B-46FF-867F-E0C5FF96C6FB}"
18 | ProjectSection(SolutionItems) = preProject
19 | scripts\buildImages.sh = scripts\buildImages.sh
20 | EndProjectSection
21 | EndProject
22 | Global
23 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
24 | Debug|Any CPU = Debug|Any CPU
25 | Debug|x64 = Debug|x64
26 | Debug|x86 = Debug|x86
27 | Release|Any CPU = Release|Any CPU
28 | Release|x64 = Release|x64
29 | Release|x86 = Release|x86
30 | EndGlobalSection
31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
32 | {C4E4A5C3-D3CB-4E91-859E-D5ABDB42F6F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33 | {C4E4A5C3-D3CB-4E91-859E-D5ABDB42F6F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
34 | {C4E4A5C3-D3CB-4E91-859E-D5ABDB42F6F5}.Debug|x64.ActiveCfg = Debug|Any CPU
35 | {C4E4A5C3-D3CB-4E91-859E-D5ABDB42F6F5}.Debug|x64.Build.0 = Debug|Any CPU
36 | {C4E4A5C3-D3CB-4E91-859E-D5ABDB42F6F5}.Debug|x86.ActiveCfg = Debug|Any CPU
37 | {C4E4A5C3-D3CB-4E91-859E-D5ABDB42F6F5}.Debug|x86.Build.0 = Debug|Any CPU
38 | {C4E4A5C3-D3CB-4E91-859E-D5ABDB42F6F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
39 | {C4E4A5C3-D3CB-4E91-859E-D5ABDB42F6F5}.Release|Any CPU.Build.0 = Release|Any CPU
40 | {C4E4A5C3-D3CB-4E91-859E-D5ABDB42F6F5}.Release|x64.ActiveCfg = Release|Any CPU
41 | {C4E4A5C3-D3CB-4E91-859E-D5ABDB42F6F5}.Release|x64.Build.0 = Release|Any CPU
42 | {C4E4A5C3-D3CB-4E91-859E-D5ABDB42F6F5}.Release|x86.ActiveCfg = Release|Any CPU
43 | {C4E4A5C3-D3CB-4E91-859E-D5ABDB42F6F5}.Release|x86.Build.0 = Release|Any CPU
44 | {4DE01154-17A6-4B2A-8BD2-2B254764651E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45 | {4DE01154-17A6-4B2A-8BD2-2B254764651E}.Debug|Any CPU.Build.0 = Debug|Any CPU
46 | {4DE01154-17A6-4B2A-8BD2-2B254764651E}.Debug|x64.ActiveCfg = Debug|Any CPU
47 | {4DE01154-17A6-4B2A-8BD2-2B254764651E}.Debug|x64.Build.0 = Debug|Any CPU
48 | {4DE01154-17A6-4B2A-8BD2-2B254764651E}.Debug|x86.ActiveCfg = Debug|Any CPU
49 | {4DE01154-17A6-4B2A-8BD2-2B254764651E}.Debug|x86.Build.0 = Debug|Any CPU
50 | {4DE01154-17A6-4B2A-8BD2-2B254764651E}.Release|Any CPU.ActiveCfg = Release|Any CPU
51 | {4DE01154-17A6-4B2A-8BD2-2B254764651E}.Release|Any CPU.Build.0 = Release|Any CPU
52 | {4DE01154-17A6-4B2A-8BD2-2B254764651E}.Release|x64.ActiveCfg = Release|Any CPU
53 | {4DE01154-17A6-4B2A-8BD2-2B254764651E}.Release|x64.Build.0 = Release|Any CPU
54 | {4DE01154-17A6-4B2A-8BD2-2B254764651E}.Release|x86.ActiveCfg = Release|Any CPU
55 | {4DE01154-17A6-4B2A-8BD2-2B254764651E}.Release|x86.Build.0 = Release|Any CPU
56 | {26A631F8-11CF-48E6-99AE-909296B2772B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57 | {26A631F8-11CF-48E6-99AE-909296B2772B}.Debug|Any CPU.Build.0 = Debug|Any CPU
58 | {26A631F8-11CF-48E6-99AE-909296B2772B}.Debug|x64.ActiveCfg = Debug|Any CPU
59 | {26A631F8-11CF-48E6-99AE-909296B2772B}.Debug|x64.Build.0 = Debug|Any CPU
60 | {26A631F8-11CF-48E6-99AE-909296B2772B}.Debug|x86.ActiveCfg = Debug|Any CPU
61 | {26A631F8-11CF-48E6-99AE-909296B2772B}.Debug|x86.Build.0 = Debug|Any CPU
62 | {26A631F8-11CF-48E6-99AE-909296B2772B}.Release|Any CPU.ActiveCfg = Release|Any CPU
63 | {26A631F8-11CF-48E6-99AE-909296B2772B}.Release|Any CPU.Build.0 = Release|Any CPU
64 | {26A631F8-11CF-48E6-99AE-909296B2772B}.Release|x64.ActiveCfg = Release|Any CPU
65 | {26A631F8-11CF-48E6-99AE-909296B2772B}.Release|x64.Build.0 = Release|Any CPU
66 | {26A631F8-11CF-48E6-99AE-909296B2772B}.Release|x86.ActiveCfg = Release|Any CPU
67 | {26A631F8-11CF-48E6-99AE-909296B2772B}.Release|x86.Build.0 = Release|Any CPU
68 | {31F54862-1799-4191-A891-3C22D438EB2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
69 | {31F54862-1799-4191-A891-3C22D438EB2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
70 | {31F54862-1799-4191-A891-3C22D438EB2D}.Debug|x64.ActiveCfg = Debug|Any CPU
71 | {31F54862-1799-4191-A891-3C22D438EB2D}.Debug|x64.Build.0 = Debug|Any CPU
72 | {31F54862-1799-4191-A891-3C22D438EB2D}.Debug|x86.ActiveCfg = Debug|Any CPU
73 | {31F54862-1799-4191-A891-3C22D438EB2D}.Debug|x86.Build.0 = Debug|Any CPU
74 | {31F54862-1799-4191-A891-3C22D438EB2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
75 | {31F54862-1799-4191-A891-3C22D438EB2D}.Release|Any CPU.Build.0 = Release|Any CPU
76 | {31F54862-1799-4191-A891-3C22D438EB2D}.Release|x64.ActiveCfg = Release|Any CPU
77 | {31F54862-1799-4191-A891-3C22D438EB2D}.Release|x64.Build.0 = Release|Any CPU
78 | {31F54862-1799-4191-A891-3C22D438EB2D}.Release|x86.ActiveCfg = Release|Any CPU
79 | {31F54862-1799-4191-A891-3C22D438EB2D}.Release|x86.Build.0 = Release|Any CPU
80 | EndGlobalSection
81 | GlobalSection(SolutionProperties) = preSolution
82 | HideSolutionNode = FALSE
83 | EndGlobalSection
84 | GlobalSection(NestedProjects) = preSolution
85 | {C4E4A5C3-D3CB-4E91-859E-D5ABDB42F6F5} = {8A0DD8FC-4167-48D5-BAED-0EB6D158B8ED}
86 | {4DE01154-17A6-4B2A-8BD2-2B254764651E} = {8A0DD8FC-4167-48D5-BAED-0EB6D158B8ED}
87 | {26A631F8-11CF-48E6-99AE-909296B2772B} = {8A0DD8FC-4167-48D5-BAED-0EB6D158B8ED}
88 | {31F54862-1799-4191-A891-3C22D438EB2D} = {31FA2789-6CDB-4BA2-B390-ACECC0824CF4}
89 | EndGlobalSection
90 | EndGlobal
91 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.suo
8 | *.user
9 | *.userosscache
10 | *.sln.docstates
11 |
12 | # User-specific files (MonoDevelop/Xamarin Studio)
13 | *.userprefs
14 |
15 | # Build results
16 | [Dd]ebug/
17 | [Dd]ebugPublic/
18 | [Rr]elease/
19 | [Rr]eleases/
20 | x64/
21 | x86/
22 | bld/
23 | [Bb]in/
24 | [Oo]bj/
25 | [Ll]og/
26 |
27 | # Visual Studio 2015 cache/options directory
28 | .vs/
29 | # Uncomment if you have tasks that create the project's static files in wwwroot
30 | #wwwroot/
31 |
32 | # MSTest test Results
33 | [Tt]est[Rr]esult*/
34 | [Bb]uild[Ll]og.*
35 |
36 | # NUNIT
37 | *.VisualState.xml
38 | TestResult.xml
39 |
40 | # Build Results of an ATL Project
41 | [Dd]ebugPS/
42 | [Rr]eleasePS/
43 | dlldata.c
44 |
45 | # .NET Core
46 | project.lock.json
47 | project.fragment.lock.json
48 | artifacts/
49 | **/Properties/launchSettings.json
50 |
51 | *_i.c
52 | *_p.c
53 | *_i.h
54 | *.ilk
55 | *.meta
56 | *.obj
57 | *.pch
58 | *.pdb
59 | *.pgc
60 | *.pgd
61 | *.rsp
62 | *.sbr
63 | *.tlb
64 | *.tli
65 | *.tlh
66 | *.tmp
67 | *.tmp_proj
68 | *.log
69 | *.vspscc
70 | *.vssscc
71 | .builds
72 | *.pidb
73 | *.svclog
74 | *.scc
75 |
76 | # Chutzpah Test files
77 | _Chutzpah*
78 |
79 | # Visual C++ cache files
80 | ipch/
81 | *.aps
82 | *.ncb
83 | *.opendb
84 | *.opensdf
85 | *.sdf
86 | *.cachefile
87 | *.VC.db
88 | *.VC.VC.opendb
89 |
90 | # Visual Studio profiler
91 | *.psess
92 | *.vsp
93 | *.vspx
94 | *.sap
95 |
96 | # TFS 2012 Local Workspace
97 | $tf/
98 |
99 | # Guidance Automation Toolkit
100 | *.gpState
101 |
102 | # ReSharper is a .NET coding add-in
103 | _ReSharper*/
104 | *.[Rr]e[Ss]harper
105 | *.DotSettings.user
106 |
107 | # JustCode is a .NET coding add-in
108 | .JustCode
109 |
110 | # TeamCity is a build add-in
111 | _TeamCity*
112 |
113 | # DotCover is a Code Coverage Tool
114 | *.dotCover
115 |
116 | # Visual Studio code coverage results
117 | *.coverage
118 | *.coveragexml
119 |
120 | # NCrunch
121 | _NCrunch_*
122 | .*crunch*.local.xml
123 | nCrunchTemp_*
124 |
125 | # MightyMoose
126 | *.mm.*
127 | AutoTest.Net/
128 |
129 | # Web workbench (sass)
130 | .sass-cache/
131 |
132 | # Installshield output folder
133 | [Ee]xpress/
134 |
135 | # DocProject is a documentation generator add-in
136 | DocProject/buildhelp/
137 | DocProject/Help/*.HxT
138 | DocProject/Help/*.HxC
139 | DocProject/Help/*.hhc
140 | DocProject/Help/*.hhk
141 | DocProject/Help/*.hhp
142 | DocProject/Help/Html2
143 | DocProject/Help/html
144 |
145 | # Click-Once directory
146 | publish/
147 |
148 | # Publish Web Output
149 | *.[Pp]ublish.xml
150 | *.azurePubxml
151 | # TODO: Comment the next line if you want to checkin your web deploy settings
152 | # but database connection strings (with potential passwords) will be unencrypted
153 | *.pubxml
154 | *.publishproj
155 |
156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
157 | # checkin your Azure Web App publish settings, but sensitive information contained
158 | # in these scripts will be unencrypted
159 | PublishScripts/
160 |
161 | # NuGet Packages
162 | *.nupkg
163 | # The packages folder can be ignored because of Package Restore
164 | **/packages/*
165 | # except build/, which is used as an MSBuild target.
166 | !**/packages/build/
167 | # Uncomment if necessary however generally it will be regenerated when needed
168 | #!**/packages/repositories.config
169 | # NuGet v3's project.json files produces more ignorable files
170 | *.nuget.props
171 | *.nuget.targets
172 |
173 | # Microsoft Azure Build Output
174 | csx/
175 | *.build.csdef
176 |
177 | # Microsoft Azure Emulator
178 | ecf/
179 | rcf/
180 |
181 | # Windows Store app package directories and files
182 | AppPackages/
183 | BundleArtifacts/
184 | Package.StoreAssociation.xml
185 | _pkginfo.txt
186 |
187 | # Visual Studio cache files
188 | # files ending in .cache can be ignored
189 | *.[Cc]ache
190 | # but keep track of directories ending in .cache
191 | !*.[Cc]ache/
192 |
193 | # Others
194 | ClientBin/
195 | ~$*
196 | *~
197 | *.dbmdl
198 | *.dbproj.schemaview
199 | *.jfm
200 | *.pfx
201 | *.publishsettings
202 | orleans.codegen.cs
203 |
204 | # Since there are multiple workflows, uncomment next line to ignore bower_components
205 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
206 | #bower_components/
207 |
208 | # RIA/Silverlight projects
209 | Generated_Code/
210 |
211 | # Backup & report files from converting an old project file
212 | # to a newer Visual Studio version. Backup files are not needed,
213 | # because we have git ;-)
214 | _UpgradeReport_Files/
215 | Backup*/
216 | UpgradeLog*.XML
217 | UpgradeLog*.htm
218 |
219 | # SQL Server files
220 | *.mdf
221 | *.ldf
222 | *.ndf
223 |
224 | # Business Intelligence projects
225 | *.rdl.data
226 | *.bim.layout
227 | *.bim_*.settings
228 |
229 | # Microsoft Fakes
230 | FakesAssemblies/
231 |
232 | # GhostDoc plugin setting file
233 | *.GhostDoc.xml
234 |
235 | # Node.js Tools for Visual Studio
236 | .ntvs_analysis.dat
237 | node_modules/
238 |
239 | # Typescript v1 declaration files
240 | typings/
241 |
242 | # Visual Studio 6 build log
243 | *.plg
244 |
245 | # Visual Studio 6 workspace options file
246 | *.opt
247 |
248 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
249 | *.vbw
250 |
251 | # Visual Studio LightSwitch build output
252 | **/*.HTMLClient/GeneratedArtifacts
253 | **/*.DesktopClient/GeneratedArtifacts
254 | **/*.DesktopClient/ModelManifest.xml
255 | **/*.Server/GeneratedArtifacts
256 | **/*.Server/ModelManifest.xml
257 | _Pvt_Extensions
258 |
259 | # Paket dependency manager
260 | .paket/paket.exe
261 | paket-files/
262 |
263 | # FAKE - F# Make
264 | .fake/
265 |
266 | # JetBrains Rider
267 | .idea/
268 | *.sln.iml
269 |
270 | # CodeRush
271 | .cr/
272 |
273 | # Python Tools for Visual Studio (PTVS)
274 | __pycache__/
275 | *.pyc
276 |
277 | # Cake - Uncomment if you are using it
278 | # tools/**
279 | # !tools/packages.config
280 |
281 | # Telerik's JustMock configuration file
282 | *.jmconfig
283 |
284 | # BizTalk build output
285 | *.btp.cs
286 | *.btm.cs
287 | *.odx.cs
288 | *.xsd.cs
289 |
--------------------------------------------------------------------------------