code: func (th *tagsHandler) GetTags(w http.ResponseWriter, r *http.Request) {
  	defer r.Body.Close()
  
  	tagService := th.Repository.Tags(th)
  	tags, err := tagService.All(th)
  	if err != nil {
  		switch err := err.(type) {
  		case distribution.ErrRepositoryUnknown:
  			th.Errors = append(th.Errors, v2.ErrorCodeNameUnknown.WithDetail(map[string]string{"name": th.Repository.Named().Name()}))
  		case errcode.Error:
  			th.Errors = append(th.Errors, err)
  		default:
  			th.Errors = append(th.Errors, errcode.ErrorCodeUnknown.WithDetail(err))
  		}
  		return
  	}
  
  	w.Header().Set("Content-Type", "application/json")
  
  	enc := json.NewEncoder(w)
  	if err := enc.Encode(tagsAPIResponse{
  		Name: th.Repository.Named().Name(),
  		Tags: tags,
  	}); err != nil {
  		th.Errors = append(th.Errors, errcode.ErrorCodeUnknown.WithDetail(err))
  		return
  	}
  }
docs: // GetTags returns a json list of tags for a specific image name.