yaml

package module
v0.0.0-...-a95e4f9 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2018 License: MIT Imports: 6 Imported by: 0

README

Gin Binding and Render yaml implement

Sample usage

package main

import (
	"github.com/alimy/gin"
	_ "github.com/alimy/gin/module/yaml"
)

func main() {
	// TODO
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type YAMLRender

type YAMLRender struct {
	Data interface{}
}

YAML contains the given interface object.

func (*YAMLRender) Render

func (r *YAMLRender) Render(w http.ResponseWriter) error

Render (YAML) marshals the given interface object and writes data with custom ContentType.

func (*YAMLRender) Reset

func (r *YAMLRender) Reset()

Reset clean data and opts

func (*YAMLRender) Setup

func (r *YAMLRender) Setup(data interface{}, opts ...interface{})

Setup set data and opts

func (*YAMLRender) WriteContentType

func (*YAMLRender) WriteContentType(w http.ResponseWriter)

WriteContentType (YAML) writes YAML ContentType for response.

type YAMLRenderFactory

type YAMLRenderFactory struct{}

func (YAMLRenderFactory) Instance

Instance a new Render instance

Jump to

Keyboard shortcuts

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