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) JSONMatrixResponse(c echo.Context, response *MatrixResponse) error
- func (m *Assembler) MarshalMatrix(records []*matrix.Matrix, query *matrix.Query) *MatrixResponse
- func (m *Assembler) MarshalSiteStats(records []siteStats.StageTime, query *siteStats.Query) *SiteStatsResponse
- type MatrixResponse
- type RequestMetadata
- type SiteStatsResponse
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
HTMLResponse renders the response into HTML format and writes it into c
func (*Assembler) JSONMatrixResponse ¶ added in v1.1.0
func (m *Assembler) JSONMatrixResponse(c echo.Context, response *MatrixResponse) error
JSONMatrixResponse renders the response into JSON format and writes it into c
func (*Assembler) MarshalMatrix ¶ added in v1.1.0
MarshalMatrix marshals records with their dependencies and gives MatrixResponse that contains rich metadata for current state of controllers
func (*Assembler) MarshalSiteStats ¶ added in v1.1.0
func (m *Assembler) MarshalSiteStats(records []siteStats.StageTime, query *siteStats.Query) *SiteStatsResponse
MarshalSiteStats marshals records with their dependencies and gives MatrixResponse that contains rich metadata for current state of controllers
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
func NewMatrixResponse ¶ added in v1.1.0
func NewMatrixResponse() *MatrixResponse
NewMatrixResponse creates a new MatrixResponse
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
type SiteStatsResponse ¶ added in v1.1.0
type SiteStatsResponse struct { Query *siteStats.Query `json:"query,omitempty"` // CacheStatus represents statuses of underlying controllers and caches of current response CacheStatus map[string]*status.Status `json:"cache,omitempty"` Stats []*siteStats.SiteStat `json:"stats,omitempty"` }
SiteStatsResponse consists additional data from the site stats result itself