Storage is a way to store checkup results in a GitHub repository.
| 24 | |
| 25 | // Storage is a way to store checkup results in a GitHub repository. |
| 26 | type Storage struct { |
| 27 | // AccessToken is the API token used to authenticate with GitHub (required). |
| 28 | AccessToken string `json:"access_token"` |
| 29 | |
| 30 | // RepositoryOwner is the account which owns the repository on GitHub (required). |
| 31 | // For https://github.com/octocat/kit, the owner is "octocat". |
| 32 | RepositoryOwner string `json:"repository_owner"` |
| 33 | |
| 34 | // RepositoryName is the name of the repository on GitHub (required). |
| 35 | // For https://github.com/octocat/kit, the name is "kit". |
| 36 | RepositoryName string `json:"repository_name"` |
| 37 | |
| 38 | // CommitterName is the display name of the user corresponding to the AccessToken (required). |
| 39 | // If the AccessToken is for user @octocat, then this might be "Mona Lisa," her name. |
| 40 | CommitterName string `json:"committer_name"` |
| 41 | |
| 42 | // CommitterEmail is the email address of the user corresponding to the AccessToken (required). |
| 43 | // If the AccessToken is for user @octocat, then this might be "mona@github.com". |
| 44 | CommitterEmail string `json:"committer_email"` |
| 45 | |
| 46 | // Branch is the git branch to store the files to (required). |
| 47 | Branch string `json:"branch"` |
| 48 | |
| 49 | // Dir is the subdirectory in the Git tree in which to store the files (required). |
| 50 | // For example, to write to the directory "updates" in the Git repo, this should be "updates". |
| 51 | Dir string `json:"dir"` |
| 52 | |
| 53 | // Check files older than CheckExpiry will be |
| 54 | // deleted on calls to Maintain(). If this is |
| 55 | // the zero value, no old check files will be |
| 56 | // deleted. |
| 57 | CheckExpiry time.Duration `json:"check_expiry,omitempty"` |
| 58 | |
| 59 | client *github.Client `json:"-"` |
| 60 | } |
| 61 | |
| 62 | // New creates a new Storage instance based on json config |
| 63 | func New(config json.RawMessage) (*Storage, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected