Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3a7a498

Browse files
committed
extract stargazer toolset
1 parentd42ced3 commit3a7a498

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

‎pkg/github/tools.go‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
3434
toolsets.NewServerTool(ListReleases(getClient,t)),
3535
toolsets.NewServerTool(GetLatestRelease(getClient,t)),
3636
toolsets.NewServerTool(GetReleaseByTag(getClient,t)),
37-
toolsets.NewServerTool(ListStarredRepositories(getClient,t)),
3837
).
3938
AddWriteTools(
4039
toolsets.NewServerTool(CreateOrUpdateFile(getClient,t)),
@@ -43,8 +42,6 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
4342
toolsets.NewServerTool(CreateBranch(getClient,t)),
4443
toolsets.NewServerTool(PushFiles(getClient,t)),
4544
toolsets.NewServerTool(DeleteFile(getClient,t)),
46-
toolsets.NewServerTool(StarRepository(getClient,t)),
47-
toolsets.NewServerTool(UnstarRepository(getClient,t)),
4845
).
4946
AddResourceTemplates(
5047
toolsets.NewServerResourceTemplate(GetRepositoryResourceContent(getClient,getRawClient,t)),
@@ -195,6 +192,12 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
195192
toolsets.NewServerTool(ListProjects(getClient,t)),
196193
)
197194

195+
stargazers:=toolsets.NewToolset("stargazers","GitHub Starring related tools").
196+
AddReadTools(toolsets.NewServerTool(ListStarredRepositories(getClient,t))).AddWriteTools(
197+
toolsets.NewServerTool(StarRepository(getClient,t)),
198+
toolsets.NewServerTool(UnstarRepository(getClient,t)),
199+
)
200+
198201
// Add toolsets to the group
199202
tsg.AddToolset(contextTools)
200203
tsg.AddToolset(repos)
@@ -212,6 +215,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
212215
tsg.AddToolset(gists)
213216
tsg.AddToolset(securityAdvisories)
214217
tsg.AddToolset(projects)
218+
tsg.AddToolset(stargazers)
215219

216220
returntsg
217221
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp