tgstation-server 6.17.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory Class Referencesealed

More...

Inheritance diagram for Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory:
Inheritance graph
[legend]
Collaboration diagram for Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory:
Collaboration graph
[legend]

Public Member Functions

 GitHubServiceFactory (IGitHubClientFactory gitHubClientFactory, ILoggerFactory loggerFactory, IOptions< UpdatesConfiguration > updatesConfigurationOptions)
 Initializes a new instance of the GitHubServiceFactory class.
 
async ValueTask< IGitHubServiceCreateService (CancellationToken cancellationToken)
 Create a IGitHubService.
Parameters
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in a new IGitHubService.

 
async ValueTask< IAuthenticatedGitHubServiceCreateService (string accessToken, CancellationToken cancellationToken)
 Create an IAuthenticatedGitHubService.
Parameters
accessTokenThe access token to use for communication with GitHub.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in a new IAuthenticatedGitHubService.

 
async ValueTask< IAuthenticatedGitHubService?> CreateService (string accessString, RepositoryIdentifier repositoryIdentifier, CancellationToken cancellationToken)
 Create an IAuthenticatedGitHubService.
Parameters
accessStringThe access token to use for communication with GitHub.
repositoryIdentifierThe RepositoryIdentifier for the repository the service will be talking with.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in a new IAuthenticatedGitHubService.

 

Private Member Functions

GitHubService CreateServiceImpl (IGitHubClient gitHubClient)
 Create a GitHubService.
 

Private Attributes

readonly IGitHubClientFactory gitHubClientFactory
 The IGitHubClientFactory for the GitHubServiceFactory.
 
readonly ILoggerFactory loggerFactory
 The ILoggerFactory for the GitHubServiceFactory.
 
readonly UpdatesConfiguration updatesConfiguration
 The UpdatesConfiguration for the GitHubServiceFactory.
 

Detailed Description

Definition at line 15 of file GitHubServiceFactory.cs.

Constructor & Destructor Documentation

◆ GitHubServiceFactory()

Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory.GitHubServiceFactory ( IGitHubClientFactory  gitHubClientFactory,
ILoggerFactory  loggerFactory,
IOptions< UpdatesConfiguration updatesConfigurationOptions 
)

Initializes a new instance of the GitHubServiceFactory class.

Parameters
gitHubClientFactoryThe value of gitHubClientFactory.
loggerFactoryThe value of loggerFactory.
updatesConfigurationOptionsThe IOptions<TOptions> containing value of updatesConfiguration.

Definition at line 38 of file GitHubServiceFactory.cs.

42 {
43 this.gitHubClientFactory = gitHubClientFactory ?? throw new ArgumentNullException(nameof(gitHubClientFactory));
44 this.loggerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory));
45 updatesConfiguration = updatesConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(updatesConfigurationOptions));
46 }
readonly UpdatesConfiguration updatesConfiguration
The UpdatesConfiguration for the GitHubServiceFactory.
readonly ILoggerFactory loggerFactory
The ILoggerFactory for the GitHubServiceFactory.
readonly IGitHubClientFactory gitHubClientFactory
The IGitHubClientFactory for the GitHubServiceFactory.

References Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory.gitHubClientFactory, Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory.loggerFactory, and Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory.updatesConfiguration.

Member Function Documentation

◆ CreateService() [1/3]

async ValueTask< IGitHubService > Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory.CreateService ( CancellationToken  cancellationToken)

Create a IGitHubService.

Parameters
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in a new IGitHubService.

Implements Tgstation.Server.Host.Utils.GitHub.IGitHubServiceFactory.

◆ CreateService() [2/3]

async ValueTask< IAuthenticatedGitHubService?> Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory.CreateService ( string  accessString,
RepositoryIdentifier  repositoryIdentifier,
CancellationToken  cancellationToken 
)

Create an IAuthenticatedGitHubService.

Parameters
accessStringThe access token to use for communication with GitHub.
repositoryIdentifierThe RepositoryIdentifier for the repository the service will be talking with.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in a new IAuthenticatedGitHubService.

Implements Tgstation.Server.Host.Utils.GitHub.IGitHubServiceFactory.

Definition at line 61 of file GitHubServiceFactory.cs.

62 {
64 accessString ?? throw new ArgumentNullException(nameof(accessString)),
65 repositoryIdentifier,
66 cancellationToken);
67 if (client == null)
68 return null;
69
70 return CreateServiceImpl(client);
71 }
GitHubService CreateServiceImpl(IGitHubClient gitHubClient)
Create a GitHubService.
ValueTask< IGitHubClient?> CreateClientForRepository(string accessString, RepositoryIdentifier repositoryIdentifier, CancellationToken cancellationToken)
Creates a GitHub client that will only be used for a given repositoryIdentifier .

References Tgstation.Server.Host.Utils.GitHub.IGitHubClientFactory.CreateClientForRepository(), Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory.CreateServiceImpl(), and Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory.gitHubClientFactory.

Here is the call graph for this function:

◆ CreateService() [3/3]

async ValueTask< IAuthenticatedGitHubService > Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory.CreateService ( string  accessToken,
CancellationToken  cancellationToken 
)

Create an IAuthenticatedGitHubService.

Parameters
accessTokenThe access token to use for communication with GitHub.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in a new IAuthenticatedGitHubService.

Implements Tgstation.Server.Host.Utils.GitHub.IGitHubServiceFactory.

◆ CreateServiceImpl()

GitHubService Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory.CreateServiceImpl ( IGitHubClient  gitHubClient)
private

Create a GitHubService.

Parameters
gitHubClientThe IGitHubClient for the GitHubService.
Returns
A new GitHubService.

Referenced by Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory.CreateService().

Here is the caller graph for this function:

Member Data Documentation

◆ gitHubClientFactory

readonly IGitHubClientFactory Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory.gitHubClientFactory
private

◆ loggerFactory

readonly ILoggerFactory Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory.loggerFactory
private

The ILoggerFactory for the GitHubServiceFactory.

Definition at line 25 of file GitHubServiceFactory.cs.

Referenced by Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory.GitHubServiceFactory().

◆ updatesConfiguration

readonly UpdatesConfiguration Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory.updatesConfiguration
private

The UpdatesConfiguration for the GitHubServiceFactory.

Definition at line 30 of file GitHubServiceFactory.cs.

Referenced by Tgstation.Server.Host.Utils.GitHub.GitHubServiceFactory.GitHubServiceFactory().


The documentation for this class was generated from the following file: