renderer

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: MIT Imports: 11 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSV

func CSV(ctx context.Context, w http.ResponseWriter, name string, data [][]string)

CSV ... CSV(UTF8)をレンダリングする

func CSVByShiftJIS

func CSVByShiftJIS(ctx context.Context, w http.ResponseWriter, name string, data [][]string)

CSVByShiftJIS ... CSV(ShiftJIS)をレンダリングする

func Error

func Error(ctx context.Context, w http.ResponseWriter, status int, msg string)

Error ... エラーレスポンスをレンダリングする

func HTML

func HTML(ctx context.Context, w http.ResponseWriter, status int, name string, values interface{})

HTML ... HTMLをレンダリングする

func HandleError

func HandleError(ctx context.Context, w http.ResponseWriter, err error)

HandleError ... よく使うエラーハンドリング

func JSON

func JSON(ctx context.Context, w http.ResponseWriter, status int, v interface{})

JSON ... JSONをレンダリングする

func Success

func Success(ctx context.Context, w http.ResponseWriter)

Success ... 成功レスポンスをレンダリングする

func Text

func Text(ctx context.Context, w http.ResponseWriter, status int, body string)

Text ... テキストをレンダリングする

Types

type ResponseError

type ResponseError struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

ResponseError ... エラーレスポンス

func NewResponseError

func NewResponseError(status int, message string) *ResponseError

NewResponseError ... エラーレスポンスを取得する

type ResponseOK

type ResponseOK struct {
	Status int `json:"status"`
}

ResponseOK ... 成功レスポンス

func NewResponseOK

func NewResponseOK(status int) *ResponseOK

NewResponseOK ... 成功レスポンスを取得する

Jump to

Keyboard shortcuts

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