@@ -19,11 +19,11 @@ type Service interface { // Get a change. Get(ctx context.Context, repo string, id uint64) (Change, error) // ListCommits lists change commits. ListCommits(ctx context.Context, repo string, id uint64) ([]Commit, error) // Get a change diff. GetDiff(ctx context.Context, repo string, id uint64, opt *ListCommitsOptions) ([]byte, error) GetDiff(ctx context.Context, repo string, id uint64, opt *GetDiffOptions) ([]byte, error) // ListComments lists comments for specified change id. ListComments(ctx context.Context, repo string, id uint64, opt *ListCommentsOptions) ([]issues.Comment, error) // ListEvents lists events for specified change id. ListEvents(ctx context.Context, repo string, id uint64, opt *ListCommentsOptions) ([]issues.Event, error) @@ -72,11 +72,11 @@ type StateFilter State const ( // AllStates is a state filter that includes all issues. AllStates StateFilter = "all" ) type ListCommitsOptions struct { type GetDiffOptions struct { // Commit is the commit ID of the commit to fetch. Commit string } // ListCommentsOptions controls pagination.
@@ -148,11 +148,11 @@ func (s service) ListCommits(ctx context.Context, _ string, id uint64) ([]change } } return commits, nil } func (s service) GetDiff(ctx context.Context, _ string, id uint64, opt *changes.ListCommitsOptions) ([]byte, error) { func (s service) GetDiff(ctx context.Context, _ string, id uint64, opt *changes.GetDiffOptions) ([]byte, error) { switch opt { case nil: diff, _, err := s.cl.Changes.GetPatch(fmt.Sprint(id), "current", &gerrit.PatchOptions{ Path: "src", // TODO. })
@@ -229,11 +229,11 @@ func (s service) ListCommits(ctx context.Context, rs string, id uint64) ([]chang }) } return commits, nil } func (s service) GetDiff(ctx context.Context, rs string, id uint64, opt *changes.ListCommitsOptions) ([]byte, error) { func (s service) GetDiff(ctx context.Context, rs string, id uint64, opt *changes.GetDiffOptions) ([]byte, error) { repo, err := ghRepoSpec(rs) if err != nil { // TODO: Map to 400 Bad Request HTTP error. return nil, err }
@@ -108,11 +108,11 @@ func (s service) Get(ctx context.Context, _ string, id uint64) (changes.Change, func (s service) ListCommits(ctx context.Context, _ string, id uint64) ([]changes.Commit, error) { return nil, fmt.Errorf("ListCommits: not implemented") } func (s service) GetDiff(ctx context.Context, _ string, id uint64, opt *changes.ListCommitsOptions) ([]byte, error) { func (s service) GetDiff(ctx context.Context, _ string, id uint64, opt *changes.GetDiffOptions) ([]byte, error) { // TODO. return nil, fmt.Errorf("GetDiff: not implemented") } func state(status string) changes.State {