routes/api/srcgraph: rename struct to match adapter package

jc/exp/srcgraph-external-service
unknwon 2019-08-03 15:30:13 -07:00
parent e688457820
commit ad927c5950
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
1 changed files with 5 additions and 5 deletions

View File

@ -18,7 +18,7 @@ import (
)
func NewHandler() http.HandlerFunc {
h := adapter.NewHandler(externalService{}, adapter.Options{
h := adapter.NewHandler(externalServicer{}, adapter.Options{
URL: setting.AppURL,
PathPrefix: "/-/srcgraph",
MaxPageLen: 100000, // Current version returns all repositories at once, does not matter
@ -26,13 +26,13 @@ func NewHandler() http.HandlerFunc {
return h.ServeHTTP
}
type externalService struct{}
type externalServicer struct{}
func (es externalService) ListRepos(ai adapter.AuthInfo, params adapter.Params) ([]*adapter.Repo, adapter.Page, error) {
func (es externalServicer) ListRepos(ai adapter.AuthInfo, params adapter.Params) ([]*adapter.Repo, adapter.Page, error) {
return es.listUserRepos("", ai, params)
}
func (es externalService) ListUserRepos(user string, ai adapter.AuthInfo, params adapter.Params) ([]*adapter.Repo, adapter.Page, error) {
func (es externalServicer) ListUserRepos(user string, ai adapter.AuthInfo, params adapter.Params) ([]*adapter.Repo, adapter.Page, error) {
return es.listUserRepos(user, ai, params)
}
@ -59,7 +59,7 @@ func toRepo(r *models.Repository) *adapter.Repo {
}
}
func (es externalService) listUserRepos(username string, ai adapter.AuthInfo, params adapter.Params) ([]*adapter.Repo, adapter.Page, error) {
func (es externalServicer) listUserRepos(username string, ai adapter.AuthInfo, params adapter.Params) ([]*adapter.Repo, adapter.Page, error) {
authUser, err := userFromAuthInfo(ai)
if err != nil {
if errors.IsUserNotExist(err) {