(_ context.Context, name string)
| 159 | } |
| 160 | |
| 161 | func (s *sqlDatabase) GetGithubEndpoint(_ context.Context, name string) (params.ForgeEndpoint, error) { |
| 162 | var endpoint GithubEndpoint |
| 163 | |
| 164 | err := s.conn.Where("name = ? and endpoint_type = ?", name, params.GithubEndpointType).First(&endpoint).Error |
| 165 | if err != nil { |
| 166 | if errors.Is(err, gorm.ErrRecordNotFound) { |
| 167 | return params.ForgeEndpoint{}, fmt.Errorf("github endpoint not found: %w", runnerErrors.ErrNotFound) |
| 168 | } |
| 169 | return params.ForgeEndpoint{}, fmt.Errorf("error fetching github endpoint: %w", err) |
| 170 | } |
| 171 | |
| 172 | return s.sqlToCommonGithubEndpoint(endpoint) |
| 173 | } |
| 174 | |
| 175 | func (s *sqlDatabase) DeleteGithubEndpoint(_ context.Context, name string) (err error) { |
| 176 | defer func() { |
no test coverage detected