render

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package render is a generated protocol buffer package.

It is generated from these files:

pb.proto

It has these top-level messages:

PB

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Data [][]byte
}

Data common bytes struct.

func (Data) Render

func (r Data) Render(w shim.ResponseWriter) (err error)

Render (Data) writes data with custom ContentType.

type JSON

type JSON struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	TTL     int         `json:"ttl"`
	Data    interface{} `json:"data,omitempty"`
}

JSON common json struct.

func (JSON) Render

func (r JSON) Render(w shim.ResponseWriter) error

Render (JSON) writes data with json ContentType.

type MapJSON

type MapJSON map[string]interface{}

MapJSON common map json struct.

func (MapJSON) Render

func (m MapJSON) Render(w shim.ResponseWriter) error

Render (MapJSON) writes data with json ContentType.

type PB

type PB struct {
	Code    int64                `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"`
	Message string               `protobuf:"bytes,2,opt,name=Message,proto3" json:"Message,omitempty"`
	TTL     uint64               `protobuf:"varint,3,opt,name=TTL,proto3" json:"TTL,omitempty"`
	Data    *google_protobuf.Any `protobuf:"bytes,4,opt,name=Data" json:"Data,omitempty"`
}

func (*PB) Descriptor

func (*PB) Descriptor() ([]byte, []int)

func (*PB) GetCode

func (m *PB) GetCode() int64

func (*PB) GetData

func (m *PB) GetData() *google_protobuf.Any

func (*PB) GetMessage

func (m *PB) GetMessage() string

func (*PB) GetTTL

func (m *PB) GetTTL() uint64

func (*PB) ProtoMessage

func (*PB) ProtoMessage()

func (PB) Render

func (m PB) Render(w shim.ResponseWriter) error

Render (PB) writes data with protobuf ContentType.

func (*PB) Reset

func (m *PB) Reset()

func (*PB) String

func (m *PB) String() string

type Render

type Render interface {
	// Render render it to http response writer.
	Render(writer shim.ResponseWriter) error
}

Render pb reponse render.

type String

type String struct {
	Format string
	Data   []interface{}
}

String common string struct.

func (String) Render

func (r String) Render(w shim.ResponseWriter) error

Render (String) writes data with custom ContentType.

type XML

type XML struct {
	Code    int
	Message string
	Data    interface{}
}

XML common xml struct.

func (XML) Render

func (r XML) Render(w shim.ResponseWriter) (err error)

Render (XML) writes data with xml ContentType.

Jump to

Keyboard shortcuts

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