Documentation
¶
Index ¶
- type AggregateRequest
- type AllRequest
- type BatchIntentHook
- type BatchRequest
- type CreateFileRequest
- type CreateIntentHook
- type CreateRequest
- type CrudHooks
- type DatabaseEventMessage
- type DeleteIntentHook
- type DeleteRequest
- type EventDocument
- type EventIntent
- type EventKind
- type FeedData
- type File
- type FileReader
- type FunctionsPayload
- type FunctionsRequest
- type GraphQLRequest
- type ListFilesRequest
- type ListFilesResponse
- type LiveQueryOptions
- type Message
- type PubsubCallback
- type PubsubMsg
- type PubsubMsgResponse
- type PubsubPublishRequest
- type PubsubSubscribeRequest
- type PubsubUnsubscribe
- type QueueEventRequest
- type RaftCommand
- type ReadOptions
- type ReadRequest
- type ReadRequestKey
- type RealtimeRequest
- type RealtimeResponse
- type ServiceRegisterRequest
- type StageEventHook
- type UpdateIntentHook
- type UpdateRequest
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 BatchIntentHook ¶ added in v0.12.0
type BatchIntentHook func(ctx context.Context, dbType string, req *BatchRequest) (*EventIntent, error)
BatchIntentHook is used to log a create intent
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 CreateIntentHook ¶ added in v0.12.0
type CreateIntentHook func(ctx context.Context, dbType, col string, req *CreateRequest) (*EventIntent, error)
CreateIntentHook is used to log a create intent
type CreateRequest ¶
type CreateRequest struct {
Document interface{} `json:"doc"`
Operation string `json:"op"`
}
CreateRequest is the http body received for a create request
type CrudHooks ¶ added in v0.12.0
type CrudHooks struct {
Create CreateIntentHook
Update UpdateIntentHook
Delete DeleteIntentHook
Batch BatchIntentHook
Stage StageEventHook
}
CrudHooks is the struct to store the hooks related to the crud module
type DatabaseEventMessage ¶ added in v0.12.0
type DatabaseEventMessage struct {
DBType string `json:"db"`
Col string `json:"col"`
DocID string `json:"docId"`
Doc interface{} `json:"doc"`
}
DatabaseEventMessage is the event payload for create, update and delete events
type DeleteIntentHook ¶ added in v0.12.0
type DeleteIntentHook func(ctx context.Context, dbType, col string, req *DeleteRequest) (*EventIntent, error)
DeleteIntentHook is used to log a create intent
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 EventDocument ¶ added in v0.12.0
type EventDocument struct {
ID string `structs:"_id" json:"_id" bson:"_id" mapstructure:"_id"`
BatchID string `structs:"batchid" json:"batchid" bson:"batchid" mapstructure:"batchid"`
Type string `structs:"type" json:"type" bson:"type" mapstructure:"type"`
Token int `structs:"token" json:"token" bson:"token" mapstructure:"token"`
Timestamp int64 `structs:"timestamp" json:"timestamp" bson:"timestamp" mapstructure:"timestamp"` // The timestamp of when the event should get executed
EventTimestamp int64 `structs:"event_timestamp" json:"event_timestamp" bson:"event_timestamp" mapstructure:"event_timestamp"` // The time stamp of when the event was logged
Payload string `structs:"payload" json:"payload" bson:"payload" mapstructure:"payload"`
Status string `structs:"status" json:"status" bson:"status" mapstructure:"status"`
Retries int `structs:"retries" json:"retries" bson:"retries" mapstructure:"retries"`
Service string `structs:"service" json:"service" bson:"service" mapstructure:"service"`
Function string `structs:"func" json:"func" bson:"function" mapstructure:"func"`
}
EventDocument is the format in which the event is persistent on disk
type EventIntent ¶ added in v0.12.0
type EventIntent struct {
BatchID string
Token int
Docs []*EventDocument
Invalid bool
}
EventIntent describes an intent made in the eventing system
type EventKind ¶ added in v0.12.0
type EventKind string
EventKind is the type describing the kind of event
type FeedData ¶
type FeedData struct {
QueryID string `json:"id" structs:"id"`
DocID string `json:"docId" structs:"docId"`
Type string `json:"type" structs:"type"`
Payload interface{} `json:"payload" structs:"payload"`
TimeStamp int64 `json:"time" structs:"time"`
Group string `json:"group" structs:"group"`
DBType string `json:"dbType" structs:"dbType"`
TypeName string `json:"__typename,omitempty" structs:"__typename,omitempty"`
}
FeedData is the format to send realtime data
type FileReader ¶
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 GraphQLRequest ¶ added in v0.12.0
type GraphQLRequest struct {
Query string `json:"query"`
OperationName string `json:"operationName"`
Variables map[string]interface{} `json:"variables"`
}
GraphQLRequest is the payload received in a graphql 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 PubsubCallback ¶ added in v0.12.0
type PubsubCallback func(msg *PubsubMsg)
type PubsubMsg ¶ added in v0.12.0
type PubsubMsg struct {
Subject string `json:"subject"`
Data interface{} `json:"data"`
}
PubsubMsg is the message recevied by the subscriber
type PubsubMsgResponse ¶ added in v0.12.0
type PubsubPublishRequest ¶ added in v0.12.0
type PubsubPublishRequest struct {
Subject string `json:"subject"`
Data interface{} `json:"data"`
}
type PubsubSubscribeRequest ¶ added in v0.12.0
type PubsubUnsubscribe ¶ added in v0.12.0
type PubsubUnsubscribe func() error
type QueueEventRequest ¶ added in v0.12.0
type QueueEventRequest struct {
Type string `json:"type"` // The type of the event
Delay int64 `json:"delay,omitempty"` // Time in seconds
Timestamp int64 `json:"timestamp,omitempty"` // Milliseconds from unix epoch (UTC)
Payload interface{} `json:"payload,omitempty"` // Payload contains necessary event dat
Options map[string]string `json:"options"`
}
QueueEventRequest is the payload to add a new event to the task queue
type RaftCommand ¶ added in v0.10.0
type RaftCommand struct {
Kind utils.RaftCommandType `json:"kind"`
ID string `json:"projectId"`
Project *config.Project `json:"project"`
Deploy *config.Deploy `json:"deploy"`
Operation *config.OperationConfig `json:"operation"`
Static *config.Static `json:"static"`
}
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 ReadRequestKey ¶ added in v0.12.0
type ReadRequestKey struct {
DBType string
Col string
HasOptions bool
Req ReadRequest
}
ReadRequestKey is the key type for the dataloader
func (ReadRequestKey) Raw ¶ added in v0.12.0
func (key ReadRequestKey) Raw() interface{}
Raw returns the raw, underlaying value of the key
func (ReadRequestKey) String ¶ added in v0.12.0
func (key ReadRequestKey) String() string
String returns a guaranteed unique string that can be used to identify an object
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 StageEventHook ¶ added in v0.12.0
type StageEventHook func(ctx context.Context, intent *EventIntent, err error)
StageEventHook is used to stage an intended event
type UpdateIntentHook ¶ added in v0.12.0
type UpdateIntentHook func(ctx context.Context, dbType, col string, req *UpdateRequest) (*EventIntent, error)
UpdateIntentHook is used to log a create intent
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