Home / File/ response_writer.go — gin Source File

response_writer.go — gin Source File

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

File go 1 imports 1 classes

Entity Profile

Dependency Diagram

graph LR
  064447d4_a1df_c2b3_6b83_369a76c9feb9["response_writer.go"]
  4d187a4e_b459_c18d_d79b_e367af9eb3b7["bufio"]
  064447d4_a1df_c2b3_6b83_369a76c9feb9 --> 4d187a4e_b459_c18d_d79b_e367af9eb3b7
  style 064447d4_a1df_c2b3_6b83_369a76c9feb9 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 gin

import (
	"bufio"
	"errors"
	"io"
	"net"
	"net/http"
)

const (
	noWritten     = -1
	defaultStatus = http.StatusOK
)

var errHijackAlreadyWritten = errors.New("gin: response body already written")

// ResponseWriter ...
type ResponseWriter interface {
	http.ResponseWriter
	http.Hijacker
	http.Flusher
	http.CloseNotifier

	// Status returns the HTTP response status code of the current request.
	Status() int

	// Size returns the number of bytes already written into the response http body.
	// See Written()
	Size() int

	// WriteString writes the string into the response body.
	WriteString(string) (int, error)

	// Written returns true if the response body was already written.
	Written() bool

	// WriteHeaderNow forces to write the http header (status code + headers).
	WriteHeaderNow()

	// Pusher get the http.Pusher for server push
	Pusher() http.Pusher
}

type responseWriter struct {
	http.ResponseWriter
	size   int
	status int
}

var _ ResponseWriter = (*responseWriter)(nil)

func (w *responseWriter) Unwrap() http.ResponseWriter {
	return w.ResponseWriter
}

// ... (82 more lines)

Dependencies

  • bufio

Frequently Asked Questions

What does response_writer.go do?
response_writer.go is a source file in the gin codebase, written in go.
What does response_writer.go depend on?
response_writer.go imports 1 module(s): bufio.

Analyze Your Own Codebase

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

Try Supermodel Free