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

Method GetFileObject

database/sql/file_store.go:323–332  ·  view source on GitHub ↗
(_ context.Context, objID uint)

Source from the content-addressed store, hash-verified

321}
322
323func (s *sqlDatabase) GetFileObject(_ context.Context, objID uint) (params.FileObject, error) {
324 var fileObj FileObject
325 if err := s.objectsConn.Preload("TagsList").Where("id = ?", objID).Omit("content").First(&fileObj).Error; err != nil {
326 if errors.Is(err, gorm.ErrRecordNotFound) {
327 return params.FileObject{}, runnerErrors.NewNotFoundError("could not find file object with ID: %d", objID)
328 }
329 return params.FileObject{}, fmt.Errorf("error trying to find file object: %w", err)
330 }
331 return s.sqlFileObjectToCommonParams(fileObj), nil
332}
333
334func (s *sqlDatabase) SearchFileObjectByTags(_ context.Context, tags []string, page, pageSize uint64) (params.FileObjectPaginatedResponse, error) {
335 if page == 0 {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected