githubClient implements the Github interface.
| 53 | |
| 54 | // githubClient implements the Github interface. |
| 55 | type githubClient struct { |
| 56 | appID int64 |
| 57 | appPrivateKey string |
| 58 | appClient *github.Client |
| 59 | // appTransport is the transport used to create the app client. |
| 60 | // It can used across multiple installation clients to reuse TCP connections to Github. |
| 61 | appTransport *ghinstallation.AppsTransport |
| 62 | managedAcct string |
| 63 | |
| 64 | // managedOrgInstallationID is usually populated when the client is created. |
| 65 | // But we do not return an error if there is any error in fetching the installation ID. |
| 66 | // This is to let admin server start even if there is an issue with Github service. |
| 67 | managedOrgInstallationID int64 |
| 68 | managedOrgFetchError error |
| 69 | |
| 70 | cacheMu sync.Mutex |
| 71 | installationCache *simplelru.LRU |
| 72 | } |
| 73 | |
| 74 | // NewGithub returns a new client for connecting to Github. |
| 75 | func NewGithub(ctx context.Context, appID int64, appPrivateKey, githubManagedAcct string, logger *zap.Logger) (Github, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected