model

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2019 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateRequest

type AggregateRequest struct {
	Pipeline  interface{} `json:"pipe"`
	Operation string      `json:"op"`
}

AggregateRequest is the http body received for an aggregate request

type AllRequest

type AllRequest struct {
	Col       string                 `json:"col"`
	Document  interface{}            `json:"doc"`
	Operation string                 `json:"op"`
	Find      map[string]interface{} `json:"find"`
	Update    map[string]interface{} `json:"update"`
	Type      string                 `json:"type"`
}

AllRequest is a union of parameters required in the various requests

type BatchRequest

type BatchRequest struct {
	Requests []AllRequest `json:"reqs"`
}

BatchRequest is the http body for a batch request

type CreateFileRequest

type CreateFileRequest struct {
	Path    string `json:"path"`
	Name    string `json:"name"`
	Type    string `json:"type"`    // Either file or dir
	MakeAll bool   `json:"makeAll"` // This option is only available for creating directories
}

CreateFileRequest is the request received to create a new file or directory

type CreateRequest

type CreateRequest struct {
	Document  interface{} `json:"doc"`
	Operation string      `json:"op"`
}

CreateRequest is the http body received for a create request

type DeleteRequest

type DeleteRequest struct {
	Find      map[string]interface{} `json:"find"`
	Operation string                 `json:"op"`
}

DeleteRequest is the http body received for a delete request

type FeedData

type FeedData struct {
	QueryID   string                 `json:"id"`
	DocID     string                 `json:"docId"`
	Type      string                 `json:"type"`
	Payload   map[string]interface{} `json:"payload"`
	TimeStamp int64                  `json:"time"`
	Group     string                 `json:"group"`
	DBType    string                 `json:"dbType"`
}

FeedData is the format to send realtime data

type File

type File struct {
	File  io.Reader
	Close func() error
}

File is the struct returned for file reads

type FileReader

type FileReader func(io.Reader) (int, error)

FileReader is a function type used for file streaming

type FunctionsPayload

type FunctionsPayload struct {
	ID      string                 `json:"id"`
	Auth    map[string]interface{} `json:"auth"`
	Params  interface{}            `json:"params"`
	Service string                 `json:"service"`
	Func    string                 `json:"func"`
	Error   string                 `json:"error"`
}

FunctionsPayload is the struct transmitted via the broker

type FunctionsRequest

type FunctionsRequest struct {
	Params  interface{} `json:"params"`
	Timeout int         `json:"timeout"`
}

FunctionsRequest is the api call request

type ListFilesRequest

type ListFilesRequest struct {
	Path string `json:"path"`
	Type string `json:"type"` // Type could be dir, file or all
}

ListFilesRequest is the request made to browse the contents inside a directory

type ListFilesResponse

type ListFilesResponse struct {
	Name string `json:"name"`
	Type string `json:"type"` // Type could be dir or file
}

ListFilesResponse is the response given to browse the contents inside a directory

type LiveQueryOptions added in v0.10.0

type LiveQueryOptions struct {
	SkipInitial bool `json:"skipInitial"`
}

LiveQueryOptions is to set the options for realtime requests

type Message

type Message struct {
	Type string      `json:"type"`
	Data interface{} `json:"data"`
	ID   string      `json:"id"` // the request id
}

Message is the request body of the message

type RaftCommand added in v0.10.0

type RaftCommand struct {
	Kind    utils.RaftCommandType `json:"kind"`
	ID      string                `json:"projectId"`
	Project *config.Project       `json:"project"`
}

RaftCommand is the object passed as a raft entry

type ReadOptions

type ReadOptions struct {
	Select   map[string]int32 `json:"select"`
	Sort     map[string]int32 `json:"sort"`
	Skip     *int64           `json:"skip"`
	Limit    *int64           `json:"limit"`
	Distinct *string          `json:"distinct"`
}

ReadOptions is the options required for a read request

type ReadRequest

type ReadRequest struct {
	Find      map[string]interface{} `json:"find"`
	Operation string                 `json:"op"`
	Options   *ReadOptions           `json:"options"`
}

ReadRequest is the http body received for a read request

type RealtimeRequest

type RealtimeRequest struct {
	Token   string                 `json:"token"`
	DBType  string                 `json:"dbType"`
	Project string                 `json:"project"`
	Group   string                 `json:"group"` // Group is the collection name
	Type    string                 `json:"type"`  // Can either be subscribe or unsubscribe
	ID      string                 `json:"id"`    // id is the query id
	Where   map[string]interface{} `json:"where"`
	Options LiveQueryOptions       `json:"options"`
}

RealtimeRequest is the object sent for realtime requests

type RealtimeResponse

type RealtimeResponse struct {
	Group string      `json:"group"` // Group is the collection name
	ID    string      `json:"id"`    // id is the query id
	Ack   bool        `json:"ack"`
	Error string      `json:"error"`
	Docs  []*FeedData `json:"docs"`
}

RealtimeResponse is the object sent for realtime requests

type ServiceRegisterRequest

type ServiceRegisterRequest struct {
	Service string `json:"service"`
	Project string `json:"project"`
	Token   string `json:"token"`
}

ServiceRegisterRequest is the register service request

type UpdateRequest

type UpdateRequest struct {
	Find      map[string]interface{} `json:"find"`
	Operation string                 `json:"op"`
	Update    map[string]interface{} `json:"update"`
}

UpdateRequest is the http body received for an update request

Jump to

Keyboard shortcuts

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