Documentation ¶
Index ¶
- Constants
- type Collection
- type Document
- type DocumentService
- type EventService
- type FailedTask
- type GatewayService
- type Key
- type NitricContext
- type NitricEvent
- type NitricRequest
- type NitricResponse
- type NitricTask
- type QueryExpression
- type QueryResult
- type QueueService
- type ReceiveOptions
- type SendBatchResponse
- type ServiceFactory
- type StorageService
- type UnimplementedDocumentPlugin
- func (p *UnimplementedDocumentPlugin) Delete(key *Key) error
- func (p *UnimplementedDocumentPlugin) Get(key *Key) (*Document, error)
- func (p *UnimplementedDocumentPlugin) Query(collection *Collection, expressions []QueryExpression, limit int, ...) (*QueryResult, error)
- func (p *UnimplementedDocumentPlugin) Set(key *Key, content map[string]interface{}) error
- type UnimplementedEventingPlugin
- type UnimplementedGatewayPlugin
- type UnimplementedQueuePlugin
- func (*UnimplementedQueuePlugin) Complete(queue string, leaseId string) error
- func (*UnimplementedQueuePlugin) Receive(options ReceiveOptions) ([]NitricTask, error)
- func (*UnimplementedQueuePlugin) Send(queue string, task NitricTask) error
- func (*UnimplementedQueuePlugin) SendBatch(queue string, tasks []NitricTask) (*SendBatchResponse, error)
- type UnimplementedServiceFactory
- func (p *UnimplementedServiceFactory) NewDocumentService() (DocumentService, error)
- func (p *UnimplementedServiceFactory) NewEventService() (EventService, error)
- func (p *UnimplementedServiceFactory) NewGatewayService() (GatewayService, error)
- func (p *UnimplementedServiceFactory) NewQueueService() (QueueService, error)
- func (p *UnimplementedServiceFactory) NewStorageService() (StorageService, error)
- type UnimplementedStoragePlugin
Constants ¶
const MaxSubCollectionDepth int = 1
MaxSubCollectionDepth - maximum number of parents a collection can support. Depth is a count of the number of parents for a collection. e.g. a collection with no parent has a depth of 0 a collection with a parent has a depth of 1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type DocumentService ¶
type DocumentService interface { Get(*Key) (*Document, error) Set(*Key, map[string]interface{}) error Delete(*Key) error Query(*Collection, []QueryExpression, int, map[string]string) (*QueryResult, error) }
The base Document Plugin interface Use this over proto definitions to remove dependency on protobuf in the plugin internally and open options to adding additional non-grpc interfaces
type EventService ¶
type EventService interface { Publish(topic string, event *NitricEvent) error ListTopics() ([]string, error) }
type FailedTask ¶
type FailedTask struct { Task *NitricTask Message string }
type GatewayService ¶
type GatewayService interface { // Start the Gateway Start(pool worker.WorkerPool) error // Stop the Gateway Stop() error }
type Key ¶
type Key struct { Collection *Collection Id string }
type NitricContext ¶
type NitricContext struct { RequestId string PayloadType string Trigger string TriggerType triggers.TriggerType }
type NitricEvent ¶
type NitricEvent struct { ID string `json:"id,omitempty"` PayloadType string `json:"payloadType,omitempty"` Payload map[string]interface{} `json:"payload,omitempty"` }
NitricEvent - An event for asynchronous processing and reactive programming
type NitricRequest ¶
type NitricRequest struct { Context *NitricContext ContentType string Payload []byte }
Normalized NitricRequest
type NitricResponse ¶
type NitricTask ¶
type NitricTask struct { ID string `json:"id,omitempty"` LeaseID string `json:"leaseId,omitempty"` PayloadType string `json:"payloadType,omitempty"` Payload map[string]interface{} `json:"payload,omitempty"` }
NitricTask - A task for asynchronous processing
type QueryExpression ¶
type QueryResult ¶
type QueueService ¶
type QueueService interface { // Send - Send a single task to a queue Send(queue string, task NitricTask) error // SendBatch - sends multiple tasks to a queue SendBatch(queue string, tasks []NitricTask) (*SendBatchResponse, error) // Receive - Receives one or more tasks(s) off a queue Receive(options ReceiveOptions) ([]NitricTask, error) // Complete - Marks a received task as completed Complete(queue string, leaseId string) error }
QueueService - The Nitric plugin interface for cloud native queue adapters
type ReceiveOptions ¶
type ReceiveOptions struct { // Nitric name for the queue. // // queueName is a required field QueueName string `type:"string" required:"true"` // Max depth of queue messages to receive from the queue. // // If nil or 0, defaults to depth 1. Depth *uint32 `type:"int" required:"false"` }
func (*ReceiveOptions) Validate ¶
func (p *ReceiveOptions) Validate() error
type SendBatchResponse ¶
type SendBatchResponse struct {
FailedTasks []*FailedTask
}
type ServiceFactory ¶
type ServiceFactory interface { NewDocumentService() (DocumentService, error) NewEventService() (EventService, error) NewGatewayService() (GatewayService, error) NewQueueService() (QueueService, error) NewStorageService() (StorageService, error) }
ServiceFactory - interface for Service Factory Plugins, which instantiate provider specific service implementations.
type StorageService ¶
type UnimplementedDocumentPlugin ¶
type UnimplementedDocumentPlugin struct {
DocumentService
}
func (*UnimplementedDocumentPlugin) Delete ¶
func (p *UnimplementedDocumentPlugin) Delete(key *Key) error
func (*UnimplementedDocumentPlugin) Get ¶
func (p *UnimplementedDocumentPlugin) Get(key *Key) (*Document, error)
func (*UnimplementedDocumentPlugin) Query ¶
func (p *UnimplementedDocumentPlugin) Query(collection *Collection, expressions []QueryExpression, limit int, pagingToken map[string]string) (*QueryResult, error)
type UnimplementedEventingPlugin ¶
type UnimplementedEventingPlugin struct {
EventService
}
func (*UnimplementedEventingPlugin) ListTopics ¶
func (*UnimplementedEventingPlugin) ListTopics() ([]string, error)
func (*UnimplementedEventingPlugin) Publish ¶
func (*UnimplementedEventingPlugin) Publish(topic string, event *NitricEvent) error
type UnimplementedGatewayPlugin ¶
type UnimplementedGatewayPlugin struct {
GatewayService
}
func (*UnimplementedGatewayPlugin) Start ¶
func (*UnimplementedGatewayPlugin) Start(_ worker.WorkerPool) error
func (*UnimplementedGatewayPlugin) Stop ¶
func (*UnimplementedGatewayPlugin) Stop() error
type UnimplementedQueuePlugin ¶
type UnimplementedQueuePlugin struct {
QueueService
}
UnimplementedQueuePlugin - A Default interface, that provide implementations of QueueService methods that Flag the method as unimplemented
func (*UnimplementedQueuePlugin) Complete ¶
func (*UnimplementedQueuePlugin) Complete(queue string, leaseId string) error
func (*UnimplementedQueuePlugin) Receive ¶
func (*UnimplementedQueuePlugin) Receive(options ReceiveOptions) ([]NitricTask, error)
func (*UnimplementedQueuePlugin) Send ¶
func (*UnimplementedQueuePlugin) Send(queue string, task NitricTask) error
Push - Unimplemented Stub for the UnimplementedQueuePlugin
func (*UnimplementedQueuePlugin) SendBatch ¶
func (*UnimplementedQueuePlugin) SendBatch(queue string, tasks []NitricTask) (*SendBatchResponse, error)
type UnimplementedServiceFactory ¶
type UnimplementedServiceFactory struct { }
UnimplementedServiceFactory - provides stub methods for a ServiceFactory which return Unimplemented Methods.
Returning nil from a New service method is a valid response. Without an accompanying error, this will be interpreted as the method being explicitly unimplemented.
Plugin Factories with unimplemented New methods are only supported when the TOLERATE_MISSING_SERVICE option is set to true when executing the pluggable membrane.
func (*UnimplementedServiceFactory) NewDocumentService ¶
func (p *UnimplementedServiceFactory) NewDocumentService() (DocumentService, error)
NewDocumentService - Unimplemented
func (*UnimplementedServiceFactory) NewEventService ¶
func (p *UnimplementedServiceFactory) NewEventService() (EventService, error)
NewEventService - Unimplemented
func (*UnimplementedServiceFactory) NewGatewayService ¶
func (p *UnimplementedServiceFactory) NewGatewayService() (GatewayService, error)
NewGatewayService - Unimplemented
func (*UnimplementedServiceFactory) NewQueueService ¶
func (p *UnimplementedServiceFactory) NewQueueService() (QueueService, error)
NewQueueService - Unimplemented
func (*UnimplementedServiceFactory) NewStorageService ¶
func (p *UnimplementedServiceFactory) NewStorageService() (StorageService, error)
NewStorageService - Unimplemented
type UnimplementedStoragePlugin ¶
type UnimplementedStoragePlugin struct{}
func (*UnimplementedStoragePlugin) Delete ¶
func (*UnimplementedStoragePlugin) Delete(bucket string, key string) error