context

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2021 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResponseContext

type ResponseContext struct {
	// contains filtered or unexported fields
}

ResponseContext is a mutex-protected medium between our ResponseWriter and controller go-routines.

func New

func New() *ResponseContext

New creates a responseContext with a mutex.

func (*ResponseContext) AddResponseHeader

func (r *ResponseContext) AddResponseHeader(key, value string) *ResponseContext

AddResponseHeader adds a new value to the *http.ResponseWriters headers.

func (*ResponseContext) Build

func (r *ResponseContext) Build() (string, map[string]string, int)

Build returns the built content, headers, and status code.

func (*ResponseContext) ResponseContent

func (r *ResponseContext) ResponseContent() string

ResponseContent retrieves ResponseContext.content.

func (*ResponseContext) SetResponseContent

func (r *ResponseContext) SetResponseContent(content string) *ResponseContext

SetResponseContent overwrites the ResponseContext.content value.

func (*ResponseContext) SetStatusCode

func (r *ResponseContext) SetStatusCode(code int) *ResponseContext

SetStatusCode overwrites the ResponseContext.statusCode.

func (*ResponseContext) StatusCode

func (r *ResponseContext) StatusCode() int

StatusCode retrieves ResponseContext.statusCode.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL