public BeatPulseContext AddLiveness(IBeatPulseLivenessRegistration registration) { if (registration == null) { throw new ArgumentNullException(nameof(registration)); } var path = registration.Path; if (!string.IsNullOrEmpty(path)) { if (!_registeredLiveness.ContainsKey(path)) { _registeredLiveness.Add(path, registration); } else { throw new InvalidOperationException($"The path {path} is already configured."); } return(this); } else { throw new InvalidOperationException("The global path is automatically used for beat pulse."); } }
internal static LivenessExecutionContext FromRegistration(IBeatPulseLivenessRegistration registration, bool showDetailedErrors) { return(new LivenessExecutionContext() { Name = registration.Name, Path = registration.Path }); }
internal static LivenessExecutionContext FromRegistration(IBeatPulseLivenessRegistration registration, bool isDevelopment) { return(new LivenessExecutionContext() { IsDevelopment = isDevelopment, Name = registration.Name, Path = registration.Path }); }
internal IBeatPulseLiveness CreateLivenessFromRegistration(IBeatPulseLivenessRegistration registration) { return(registration.GetOrCreateLiveness(_serviceProvider)); }