// WriteResponse to the client func (o *GetTaskCommentsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(200) if err := producer.Produce(rw, o.Payload); err != nil { panic(err) // let the recovery middleware deal with this } }
// WriteResponse to the client func (o *UpdateOneDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(o._statusCode) if o.Payload != nil { if err := producer.Produce(rw, o.Payload); err != nil { panic(err) // let the recovery middleware deal with this } } }
// WriteResponse to the client func (o *UpdateTaskUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(422) if o.Payload != nil { if err := producer.Produce(rw, o.Payload); err != nil { panic(err) // let the recovery middleware deal with this } } }
// WriteResponse to the client func (o *AddOneCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(201) if o.Payload != nil { if err := producer.Produce(rw, o.Payload); err != nil { panic(err) // let the recovery middleware deal with this } } }
// WriteResponse to the client func (o *ListTasksOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { // response header X-Last-Task-Id rw.Header().Add("X-Last-Task-Id", fmt.Sprintf("%v", o.XLastTaskID)) rw.WriteHeader(200) if err := producer.Produce(rw, o.Payload); err != nil { panic(err) // let the recovery middleware deal with this } }
// WriteResponse to the client func (o *UploadTaskFileDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { // response header X-Error-Code rw.Header().Add("X-Error-Code", fmt.Sprintf("%v", o.XErrorCode)) rw.WriteHeader(o._statusCode) if o.Payload != nil { if err := producer.Produce(rw, o.Payload); err != nil { panic(err) // let the recovery middleware deal with this } } }
func (e *errorResp) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { for k, v := range e.headers { for _, val := range v { rw.Header().Add(k, val) } } if e.code > 0 { rw.WriteHeader(e.code) } else { rw.WriteHeader(http.StatusInternalServerError) } if err := producer.Produce(rw, e.response); err != nil { panic(err) } }