render

package
v0.0.0-...-89e5b94 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONRender

type JSONRender struct {
	Data proto.Message
	protojson.MarshalOptions
	// contains filtered or unexported fields
}

func (*JSONRender) Render

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

Render writes data with custom ContentType.

func (*JSONRender) RenderToBytes

func (r *JSONRender) RenderToBytes() ([]byte, error)

RenderToBytes renders data to bytes.

func (*JSONRender) WriteContentType

func (r *JSONRender) WriteContentType(w http.ResponseWriter)

WriteContentType writes custom ContentType.

type ProtoRender

type ProtoRender struct {
	Data proto.Message
	// contains filtered or unexported fields
}

ProtoRender contains the given interface object.

func (*ProtoRender) Render

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

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

func (*ProtoRender) RenderToBytes

func (r *ProtoRender) RenderToBytes() ([]byte, error)

RenderToBytes render data to bytes.

func (*ProtoRender) WriteContentType

func (r *ProtoRender) WriteContentType(w http.ResponseWriter)

WriteContentType (ProtoBuf) writes ProtoBuf ContentType.

type Render

type Render interface {
	// Render is the gin render.
	render.Render
	// RenderToBytes renders data to bytes.
	RenderToBytes() ([]byte, error)
}

Render interface is the gin Render interface plus `RenderToBytes` method.

Jump to

Keyboard shortcuts

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