MCPcopy Create free account
hub / github.com/cloudbase/garm / DeleteEntityHook

Method DeleteEntityHook

util/github/client.go:143–168  ·  view source on GitHub ↗
(ctx context.Context, id int64)

Source from the content-addressed store, hash-verified

141}
142
143func (g *githubClient) DeleteEntityHook(ctx context.Context, id int64) (ret *github.Response, err error) {
144 metrics.GithubOperationCount.WithLabelValues(
145 "DeleteHook", // label: operation
146 g.entity.LabelScope(), // label: scope
147 ).Inc()
148 defer func() {
149 if err != nil {
150 metrics.GithubOperationFailedCount.WithLabelValues(
151 "DeleteHook", // label: operation
152 g.entity.LabelScope(), // label: scope
153 ).Inc()
154 }
155 }()
156 switch g.entity.EntityType {
157 case params.ForgeEntityTypeRepository:
158 ret, err = g.repo.DeleteHook(ctx, g.entity.Owner, g.entity.Name, id)
159 case params.ForgeEntityTypeOrganization:
160 ret, err = g.org.DeleteHook(ctx, g.entity.Owner, id)
161 default:
162 return nil, errors.New("invalid entity type")
163 }
164 if err == nil && ret != nil {
165 g.recordLimits(ret.Rate)
166 }
167 return ret, err
168}
169
170func (g *githubClient) PingEntityHook(ctx context.Context, id int64) (ret *github.Response, err error) {
171 metrics.GithubOperationCount.WithLabelValues(

Callers

nothing calls this directly

Calls 2

recordLimitsMethod · 0.95
LabelScopeMethod · 0.80

Tested by

no test coverage detected