Compare commits
17 Commits
5
.github/config/gitversion.yml
vendored
5
.github/config/gitversion.yml
vendored
@@ -1,10 +1,9 @@
|
||||
next-version: 1.0.0
|
||||
next-version: 1.1.0
|
||||
mode: ContinuousDeployment
|
||||
assembly-versioning-scheme: MajorMinorPatch
|
||||
assembly-file-versioning-scheme: MajorMinorPatch
|
||||
|
||||
branches:
|
||||
main:
|
||||
regex: ^main$
|
||||
mode: ContinuousDelivery
|
||||
increment: Patch
|
||||
is-release-branch: true
|
||||
|
||||
4
.github/workflows/push_main.yml
vendored
4
.github/workflows/push_main.yml
vendored
@@ -4,8 +4,8 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
#paths:
|
||||
#- "TimetableDesigner.Backend.Events**"
|
||||
paths:
|
||||
- "TimetableDesigner.Backend.Events**"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Mateusz Skoczek
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -2,7 +2,16 @@
|
||||
|
||||
namespace TimetableDesigner.Backend.Events;
|
||||
|
||||
public abstract class EventQueue
|
||||
public abstract class EventQueue<TSelf> where TSelf : EventQueue<TSelf>
|
||||
{
|
||||
internal abstract void Setup(IServiceCollection services);
|
||||
}
|
||||
public void Setup<TBuilder>(IServiceCollection services, TBuilder configuration)
|
||||
where TBuilder : EventQueueBuilder<TSelf> =>
|
||||
Setup(services, configuration.GetConnectionParameters());
|
||||
|
||||
public void Setup(IServiceCollection services, string connectionString)
|
||||
=> Setup(services, connectionString.Split(';')
|
||||
.Select(x => x.Split('='))
|
||||
.ToDictionary(x => x.First(), x => x.Last()));
|
||||
|
||||
protected abstract void Setup(IServiceCollection services, IDictionary<string, string> connectionParameters);
|
||||
}
|
||||
|
||||
6
TimetableDesigner.Backend.Events/EventQueueBuilder.cs
Normal file
6
TimetableDesigner.Backend.Events/EventQueueBuilder.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace TimetableDesigner.Backend.Events;
|
||||
|
||||
public abstract class EventQueueBuilder<TQueue> where TQueue : EventQueue<TQueue>
|
||||
{
|
||||
public abstract IDictionary<string, string> GetConnectionParameters();
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
namespace TimetableDesigner.Backend.Events;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
|
||||
namespace TimetableDesigner.Backend.Events;
|
||||
|
||||
public interface IEventQueuePublisher
|
||||
{
|
||||
public Task PublishAsync<T>(T data) where T : class;
|
||||
public sealed Task PublishAsync<T>(T data) where T : class => PublishAsync(JsonSerializer.Serialize(data), data.GetType());
|
||||
public Task PublishAsync(string data, Type dataType);
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<Title>TimetableDesigner.Backend.Events</Title>
|
||||
<Authors>Mateusz Skoczek</Authors>
|
||||
<PackageProjectUrl>https://github.com/TimetableDesigner/</PackageProjectUrl>
|
||||
<PackageProjectUrl>https://github.com/TimetableDesigner</PackageProjectUrl>
|
||||
<PackageIcon>icon.png</PackageIcon>
|
||||
<RepositoryUrl>https://github.com/TimetableDesigner/TimetableDesigner.Backend.Events</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
Reference in New Issue
Block a user