IConfigClient.cs 835 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using Agile.Config.Protocol;
  2. using System;
  3. using System.Collections.Concurrent;
  4. using System.Collections.Generic;
  5. using System.Threading.Tasks;
  6. namespace Agile.Config.Client
  7. {
  8. public class ConfigChangedArg
  9. {
  10. public ConfigChangedArg(string action, string key)
  11. {
  12. Action = action;
  13. Key = key;
  14. }
  15. public string Key { get; }
  16. public string Action { get; }
  17. }
  18. public interface IConfigClient
  19. {
  20. string this[string key] { get; }
  21. string Get(string key);
  22. List<ConfigItem> GetGroup(string groupName);
  23. ConcurrentDictionary<string, string> Data { get; }
  24. Task<bool> ConnectAsync();
  25. bool Load();
  26. void LoadConfigs(List<ConfigItem> configs);
  27. event Action<ConfigChangedArg> ConfigChanged;
  28. }
  29. }