Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Latest commit

 

History

History
40 lines (29 loc) · 989 Bytes

README.md

File metadata and controls

40 lines (29 loc) · 989 Bytes

gear-partial-response

Build Status Coverage Status

Partial response middleware for Gear.

Installation

go get -u github.com/teambition/gear-partial-response

Documentation

API documentation can be found here: https://godoc.org/github.com/teambition/gear-partial-response

Usage

import (
	"github.com/teambition/gear"
	partial "github.com/teambition/gear-partial-response"
)

When initializing the gear application:

app := gear.New()
app.Set(gear.SetSender, partial.New(partial.Options{Query: "fields"}))

In controller function:

app.Use(func(ctx *gear.Context) error {
	// ...
	return ctx.Send(http.StatusOK, data)
})