Documentation
¶
Index ¶
- type EventService
- type FailedTask
- type GatewayService
- type KeyValueService
- type NitricContext
- type NitricEvent
- type NitricRequest
- type NitricResponse
- type NitricTask
- type QueueService
- type ReceiveOptions
- type SendBatchResponse
- type ServiceFactory
- type StorageService
- type UnimplementedAuthPlugin
- type UnimplementedEventingPlugin
- type UnimplementedGatewayPlugin
- type UnimplementedKeyValuePlugin
- 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) NewAuthService() (UserService, error)
- func (p *UnimplementedServiceFactory) NewEventService() (EventService, error)
- func (p *UnimplementedServiceFactory) NewGatewayService() (GatewayService, error)
- func (p *UnimplementedServiceFactory) NewKeyValueService() (KeyValueService, error)
- func (p *UnimplementedServiceFactory) NewQueueService() (QueueService, error)
- func (p *UnimplementedServiceFactory) NewStorageService() (StorageService, error)
- type UnimplementedStoragePlugin
- type UserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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
// Stops the Gateway
Stop() error
}
type KeyValueService ¶
type KeyValueService interface {
Put(string, string, map[string]interface{}) error
Get(string, string) (map[string]interface{}, error)
Delete(string, string) error
}
The base KeyValue 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 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 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 {
NewAuthService() (UserService, error)
NewKeyValueService() (KeyValueService, 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 UnimplementedAuthPlugin ¶
type UnimplementedAuthPlugin struct {
UserService
}
UnimplementedAuthPlugin - Unimplemented stub struct for extension for partial implementation of the UserService
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 UnimplementedKeyValuePlugin ¶
type UnimplementedKeyValuePlugin struct {
KeyValueService
}
func (*UnimplementedKeyValuePlugin) Delete ¶
func (p *UnimplementedKeyValuePlugin) Delete(collection string, key string) 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) NewAuthService ¶
func (p *UnimplementedServiceFactory) NewAuthService() (UserService, error)
NewAuthService - 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) NewKeyValueService ¶
func (p *UnimplementedServiceFactory) NewKeyValueService() (KeyValueService, error)
NewKeyValueService - 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