コード例 #1
0
 /// <summary>
 /// Constructor  with two injectable fetchers (default & fallback) and
 /// a baseline resilience policy (timeout & circuit breaker)
 /// </summary>
 /// <param name="defaultCommitFetcher"></param>
 /// <param name="fallbackCommitFetcher"></param>
 /// <param name="commitViewerLog"></param>
 /// <param name="baseResiliencePolicy"></param>
 public CommitsController(ICommitFetcher <CommitDTO> defaultCommitFetcher,
                          ICommitFetcher <CommitDTO> fallbackCommitFetcher,
                          IAsyncPolicy baseResiliencePolicy,
                          ICommitViewerLog commitViewerLog)
 {
     this.defaultCommitFetcher  = defaultCommitFetcher;
     this.fallbackCommitFetcher = fallbackCommitFetcher;
     this.commitViewerLog       = commitViewerLog;
     this.baseResiliencePolicy  = baseResiliencePolicy;
 }
コード例 #2
0
 public CommitParser(ICommitIdParser commitIdParser,
                     ICommitAuthorParser commitAuthorParser,
                     ICommitDateParser commitDateParser,
                     ICommitMessageParser commitMessageParser,
                     ICommitViewerLog commitViewerLogger)
 {
     this.commitIdParser      = commitIdParser;
     this.commitAuthorParser  = commitAuthorParser;
     this.commitDateParser    = commitDateParser;
     this.commitMessageParser = commitMessageParser;
     this.logger = commitViewerLogger;
 }
コード例 #3
0
 public GithubCommitFetcher(string gitHubBaseEndpoint,
                            int timeoutMs,
                            ICommitViewerLog logger)
 {
     this.githubClient             = new HttpClient();
     this.githubClient.BaseAddress = new Uri(gitHubBaseEndpoint);
     this.githubClient.Timeout     = TimeSpan.FromMilliseconds(timeoutMs);
     this.githubClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/vnd.github.v3+json"));
     this.githubClient.DefaultRequestHeaders.Add("User-Agent", $"{nameof(GithubCommitFetcher)}App");
     this.logger = logger;
     // to be able to perform https requests
     ServicePointManager.SecurityProtocol  = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
     ServicePointManager.Expect100Continue = false;
 }
コード例 #4
0
 public GitCLICommitFetcher(ICommitParser commitParser,
                            ICommitViewerLog commitViewerLog)
 {
     this.commitParser = commitParser;
     this.logger       = commitViewerLog;
 }