func (r *GormTrackerRepository) Load(ctx context.Context, ID string) (*app.Tracker, error) {
	id, err := strconv.ParseUint(ID, 10, 64)
	if err != nil || id == 0 {
		// treating this as a not found error: the fact that we're using number internal is implementation detail
		return nil, NotFoundError{"tracker", ID}
	}

	log.Info(ctx, map[string]interface{}{
		"tracker_id": id,
	}, "Loading tracker repository...")

	res := Tracker{}
	tx := r.db.First(&res, id)
	if tx.RecordNotFound() {
		log.Error(ctx, map[string]interface{}{
			"tracker_id": ID,
		}, "tracker repository not found")

		return nil, NotFoundError{"tracker", ID}
	}
	if tx.Error != nil {
		return nil, InternalError{simpleError{fmt.Sprintf("error while loading: %s", tx.Error.Error())}}
	}
	t := app.Tracker{
		ID:   strconv.FormatUint(res.ID, 10),
		URL:  res.URL,
		Type: res.Type}

	return &t, nil
}
// Load returns the tracker configuration for the given id
// returns NotFoundError, ConversionError or InternalError
Load returns the tracker configuration for the given id
returns NotFoundError, ConversionError or InternalError
// Load returns the tracker configuration for the given id // returns NotFoundError ConversionError or InternalError
func (r *GormTrackerRepository) Load(ctx context.Context, ID string) (*app.Tracker, error) {
	id, err := strconv.ParseUint(ID, 10, 64)
	if err != nil || id == 0 {
		return nil, NotFoundError{"tracker", ID}
	}
	log.Info(ctx, map[string]interface{}{
		"tracker_id": id,
	}, "Loading tracker repository...")
	res := Tracker{}
	tx := r.db.First(&res, id)
	if tx.RecordNotFound() {
		log.Error(ctx, map[string]interface{}{
			"tracker_id": ID,
		}, "tracker repository not found")
		return nil, NotFoundError{"tracker", ID}
	}
	if tx.Error != nil {
		return nil, InternalError{simpleError{fmt.Sprintf("error while loading: %s", tx.Error.Error())}}
	}
	t := app.Tracker{
		ID:   strconv.FormatUint(res.ID, 10),
		URL:  res.URL,
		Type: res.Type}
	return &t, nil
}
func ( r * GormTrackerRepository ) Load ( ctx context . Context , ID string ) ( * app . Tracker , error ) { id , err := strconv . ParseUint ( ID , 10 , 64 ) if err != nil || id == 0 { return nil , NotFoundError { " " , ID } } log . Info ( ctx , map [ string ] interface { } { " " : id , } , " " ) res := Tracker { } tx := r . db . First ( & res , id ) if tx . RecordNotFound ( ) { log . Error ( ctx , map [ string ] interface { } { " " : ID , } , " " ) return nil , NotFoundError { " " , ID } } if tx . Error != nil { return nil , InternalError { simpleError { fmt . Sprintf ( " " , tx . Error . Error ( ) ) } } } t := app . Tracker { ID : strconv . FormatUint ( res . ID , 10 ) , URL : res . URL , Type : res . Type } return & t , nil }
Load returns the tracker configuration for the given id
returns NotFoundError, ConversionError or InternalError
Load returns the tracker configuration for the given id returns NotFoundError ConversionError or InternalError
// treating this as a not found error: the fact that we're using number internal is implementation detail