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 ¶
- type Data
- type JSON
- type MapJSON
- type PB
- func (*PB) Descriptor() ([]byte, []int)
- func (m *PB) GetCode() int64
- func (m *PB) GetData() *google_protobuf.Any
- func (m *PB) GetMessage() string
- func (m *PB) GetTTL() uint64
- func (*PB) ProtoMessage()
- func (r PB) Render(w http.ResponseWriter) error
- func (m *PB) Reset()
- func (m *PB) String() string
- func (r PB) WriteContentType(w http.ResponseWriter)
- type Redirect
- type Render
- type String
- type XML
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
Data common bytes struct.
func (Data) Render ¶
func (r Data) Render(w http.ResponseWriter) (err error)
Render (Data) writes data with custom ContentType.
func (Data) WriteContentType ¶
func (r Data) WriteContentType(w http.ResponseWriter)
WriteContentType writes data with custom ContentType.
type JSON ¶
type JSON struct { Code int `json:"status"` // 兼容nova1返回值 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 http.ResponseWriter) error
Render (JSON) writes data with json ContentType.
func (JSON) WriteContentType ¶
func (r JSON) WriteContentType(w http.ResponseWriter)
WriteContentType write json ContentType.
type MapJSON ¶
type MapJSON map[string]interface{}
MapJSON common map json struct.
func (MapJSON) Render ¶
func (m MapJSON) Render(w http.ResponseWriter) error
Render (MapJSON) writes data with json ContentType.
func (MapJSON) WriteContentType ¶
func (m MapJSON) WriteContentType(w http.ResponseWriter)
WriteContentType write 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) GetData ¶
func (m *PB) GetData() *google_protobuf.Any
func (*PB) GetMessage ¶
func (*PB) ProtoMessage ¶
func (*PB) ProtoMessage()
func (PB) Render ¶
func (r PB) Render(w http.ResponseWriter) error
Render (PB) writes data with protobuf ContentType.
func (PB) WriteContentType ¶
func (r PB) WriteContentType(w http.ResponseWriter)
WriteContentType write protobuf ContentType.
type Redirect ¶
Redirect render for redirect to specified location.
func (Redirect) Render ¶
func (r Redirect) Render(w http.ResponseWriter) error
Render (Redirect) redirect to specified location.
func (Redirect) WriteContentType ¶
func (r Redirect) WriteContentType(http.ResponseWriter)
WriteContentType noneContentType.
type Render ¶
type Render interface { // Render render it to http response writer. Render(http.ResponseWriter) error // WriteContentType write content-type to http response writer. WriteContentType(w http.ResponseWriter) }
Render http reponse render.
type String ¶
type String struct { Format string Data []interface{} }
String common string struct.
func (String) Render ¶
func (r String) Render(w http.ResponseWriter) error
Render (String) writes data with custom ContentType.
func (String) WriteContentType ¶
func (r String) WriteContentType(w http.ResponseWriter)
WriteContentType writes string with text/plain ContentType.
type XML ¶
XML common xml struct.
func (XML) Render ¶
func (r XML) Render(w http.ResponseWriter) (err error)
Render (XML) writes data with xml ContentType.
func (XML) WriteContentType ¶
func (r XML) WriteContentType(w http.ResponseWriter)
WriteContentType write xml ContentType.