Home / File/ data.go — gin Source File

data.go — gin Source File

Architecture documentation for data.go, a go file in the gin codebase. 1 imports, 0 dependents.

File go 1 imports

Entity Profile

Dependency Diagram

graph LR
  a59e07fa_b5b8_d6f1_21f3_7094c2a2c2f9["data.go"]
  08248871_dc00_f330_15ef_4a0fbf2bafbb["http"]
  a59e07fa_b5b8_d6f1_21f3_7094c2a2c2f9 --> 08248871_dc00_f330_15ef_4a0fbf2bafbb
  style a59e07fa_b5b8_d6f1_21f3_7094c2a2c2f9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.

package render

import "net/http"

// Data contains ContentType and bytes data.
type Data struct {
	ContentType string
	Data        []byte
}

// Render (Data) writes data with custom ContentType.
func (r Data) Render(w http.ResponseWriter) (err error) {
	r.WriteContentType(w)
	_, err = w.Write(r.Data)
	return
}

// WriteContentType (Data) writes custom ContentType.
func (r Data) WriteContentType(w http.ResponseWriter) {
	writeContentType(w, []string{r.ContentType})
}

Types

Dependencies

  • http

Frequently Asked Questions

What does data.go do?
data.go is a source file in the gin codebase, written in go.
What does data.go depend on?
data.go imports 1 module(s): http.
Where is data.go in the architecture?
data.go is located at render/data.go (directory: render).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free