http

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CSVContentType = []string{"application/csv"}
)

CSVContentType

Functions

func FormatCSV

func FormatCSV(records [][]string) (res []byte)

FormatCSV format csv data.

func Init

func Init(c *conf.Config)

Init http server

Types

type CSV

type CSV struct {
	Content []byte
	Title   string
}

CSV str.

func (CSV) Render

func (j CSV) Render(w http.ResponseWriter) (err error)

Render (JSON) writes data with json ContentType.

func (CSV) WriteContentType

func (j CSV) WriteContentType(w http.ResponseWriter)

WriteContentType fn

type Render

type Render interface {
	Render(http.ResponseWriter) error
	WriteContentType(w http.ResponseWriter)
}

Render http reponse render.

Jump to

Keyboard shortcuts

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