mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 16:50:10 +00:00
Add Elastic-bound logging of (almost) all database update events
This commit is contained in:
parent
8d27148bdf
commit
9955dc29f9
11 changed files with 182 additions and 45 deletions
|
|
@ -10,10 +10,11 @@ using Newtonsoft.Json;
|
|||
namespace PluralKit.Core
|
||||
{
|
||||
[JsonConverter(typeof(PartialConverter))]
|
||||
public struct Partial<T>: IEnumerable<T>
|
||||
public struct Partial<T>: IEnumerable<T>, IPartial
|
||||
{
|
||||
public bool IsPresent { get; }
|
||||
public T Value { get; }
|
||||
public object? RawValue => Value;
|
||||
|
||||
private Partial(bool isPresent, T value)
|
||||
{
|
||||
|
|
@ -34,6 +35,12 @@ namespace PluralKit.Core
|
|||
public static implicit operator Partial<T>(T val) => Present(val);
|
||||
}
|
||||
|
||||
public interface IPartial
|
||||
{
|
||||
public bool IsPresent { get; }
|
||||
public object? RawValue { get; }
|
||||
}
|
||||
|
||||
public class PartialConverter: JsonConverter
|
||||
{
|
||||
public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue