matrix

package
v1.1.3-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller consists instance for a type of data. Matrix controller consists a slice of utils.Cache which contains data from multiple server

func New

func New() *Controller

New creates a new Controller with its corresponding utils.Cache

func (*Controller) Query

func (c *Controller) Query(query *Query) (results []*Matrix, err *errors.Error)

Query queries a set of matrix response using provided Query

func (*Controller) Server

func (c *Controller) Server(server string) (*utils.Cache, *errors.Error)

Server gives utils.Cache of server

func (*Controller) ServerContent

func (c *Controller) ServerContent(server string) ([]*Matrix, *errors.Error)

ServerContent gives matrices from utils.Cache of server

func (*Controller) Status

func (c *Controller) Status(server string) *status.Status

Status gives status.Status of current controller with the status of utils.Cache for server

type Matrix

type Matrix struct {
	StageID  string `json:"stageId,omitempty"`
	ItemID   string `json:"itemId,omitempty"`
	Quantity int    `json:"quantity"` // cannot omitempty as it is zeroable
	Times    int    `json:"times"`    // cannot omitempty as it is zeroable
	Start    *int64 `json:"start,omitempty"`
	End      *int64 `json:"end,omitempty"`
}

Matrix specifies data structure for the matrix data type

type Query

type Query struct {
	// StageID is the query stageId of the current response; empty represents stageId hasn't been used as one of the constraints
	StageID string `json:"stageId,omitempty"`

	// ItemID is the query itemId of the current response; empty represents itemId hasn't been used as one of the constraints
	ItemID string `json:"itemId,omitempty"`

	// Server is the server to query matrix of
	Server string `json:"server,omitempty"`
}

Query describes a query on Matrix

Jump to

Keyboard shortcuts

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