...

Source file src/github.com/go-chi/chi/_examples/versions/presenter/v1/article.go

Documentation: github.com/go-chi/chi/_examples/versions/presenter/v1

     1  package v1
     2  
     3  import (
     4  	"net/http"
     5  
     6  	"github.com/go-chi/chi/_examples/versions/data"
     7  )
     8  
     9  // Article presented in API version 1.
    10  type Article struct {
    11  	*data.Article
    12  
    13  	Data map[string]bool `json:"data" xml:"data"`
    14  }
    15  
    16  func (a *Article) Render(w http.ResponseWriter, r *http.Request) error {
    17  	return nil
    18  }
    19  
    20  func NewArticleResponse(article *data.Article) *Article {
    21  	return &Article{Article: article}
    22  }
    23  

View as plain text