Documentation
¶
Index ¶
- type Assembler
- func (m *Assembler) HTMLError(error *errors.Error) (int, []byte)
- func (m *Assembler) HTMLResponse(c echo.Context, response *MatrixResponse) error
- func (m *Assembler) JSONError(error *errors.Error) (int, interface{})
- func (m *Assembler) JSONResponse(c echo.Context, response *MatrixResponse) error
- func (m *Assembler) Marshal(records []*matrix.Matrix, query *matrix.Query) *MatrixResponse
- type MatrixResponse
- type RequestMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assembler ¶
type Assembler struct {
// contains filtered or unexported fields
}
Assembler is to marshal records
func New ¶
func New(collection *meta.Collection, resourceLocation string) *Assembler
New creates a new Assembler that marshals records
func (*Assembler) HTMLResponse ¶
func (m *Assembler) HTMLResponse(c echo.Context, response *MatrixResponse) error
func (*Assembler) JSONResponse ¶
func (m *Assembler) JSONResponse(c echo.Context, response *MatrixResponse) error
type MatrixResponse ¶
type MatrixResponse struct { Request *RequestMetadata `json:"request,omitempty"` Query *matrix.Query `json:"query,omitempty"` // CacheStatus represents statuses of underlying controllers and caches of current response CacheStatus map[string]*status.Status `json:"cache,omitempty"` Items []*item.Item `json:"items,omitempty"` Matrix []*matrix.Matrix `json:"matrix,omitempty"` Stages []*stage.Stage `json:"stages,omitempty"` Zones []*zone.Zone `json:"zones,omitempty"` }
MatrixResponse consists additional data from the matrix result itself
type RequestMetadata ¶
type RequestMetadata struct { // Mirror is the preferred mirror to select from; oftenly chose with reference of `CF-IPCountry` header Mirror string `json:"mirror,omitempty"` }
RequestMetadata describes metadata related to the subsequent request
Click to show internal directories.
Click to hide internal directories.