TomGitHubStorage constructor

TomGitHubStorage({
  1. required TomTokenSource tokens,
  2. GitHubApiClient clientFactory(
    1. String secret
    )?,
  3. DateTime clock()?,
  4. TomDiagnostics diagnostics = const TomNullDiagnostics(),
  5. TomStorageCache? cache,
  6. String commitMessagePrefix = '',
  7. GitHubGitIdentity? committer,
})

A backend that authenticates from tokens on first use (and re-reads them on every request — see authenticate). clientFactory builds the client from the secret; the default reaches api.github.com.

Implementation

TomGitHubStorage({
  required TomTokenSource tokens,
  GitHubApiClient Function(String secret)? clientFactory,
  DateTime Function()? clock,
  this.diagnostics = const TomNullDiagnostics(),
  this.cache,
  this.commitMessagePrefix = '',
  this.committer,
}) : _tokens = tokens,
     _clientFactory = clientFactory ?? _defaultClient,
     _clock = clock ?? _utcNow;