github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/examples/gno.land/p/demo/mux/response.gno (about)

     1  package mux
     2  
     3  import (
     4  	"strings"
     5  )
     6  
     7  // ResponseWriter represents the response writer.
     8  type ResponseWriter struct {
     9  	output strings.Builder
    10  }
    11  
    12  // Write appends data to the response output.
    13  func (rw *ResponseWriter) Write(data string) {
    14  	rw.output.WriteString(data)
    15  }
    16  
    17  // Output returns the final response output.
    18  func (rw *ResponseWriter) Output() string {
    19  	return rw.output.String()
    20  }
    21  
    22  // TODO: func (rw *ResponseWriter) Header()...