queue_service

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() (sdk.QueueService, error)

func NewWithStorageDriver

func NewWithStorageDriver(driver StorageDriver) (sdk.QueueService, error)

Types

type DefaultQueueDriver

type DefaultQueueDriver struct{}

func (*DefaultQueueDriver) DeleteFile

func (s *DefaultQueueDriver) DeleteFile(file string) error

func (*DefaultQueueDriver) EnsureDirExists

func (s *DefaultQueueDriver) EnsureDirExists(dir string) error

EnsureDirExists - Recurively creates directories for the given path

func (*DefaultQueueDriver) ExistsOrFail

func (s *DefaultQueueDriver) ExistsOrFail(path string) error

func (*DefaultQueueDriver) ReadFile

func (s *DefaultQueueDriver) ReadFile(file string) ([]byte, error)

func (*DefaultQueueDriver) WriteFile

func (s *DefaultQueueDriver) WriteFile(file string, contents []byte, fileMode os.FileMode) error

WriteFile - Writes the given byte array to the given path

type DevQueueService

type DevQueueService struct {
	sdk.UnimplementedQueuePlugin
	// contains filtered or unexported fields
}

func (*DevQueueService) Complete

func (s *DevQueueService) Complete(queue string, leaseId string) error

Completes a previously popped queue item

func (*DevQueueService) Receive

func (s *DevQueueService) Receive(options sdk.ReceiveOptions) ([]sdk.NitricTask, error)

func (*DevQueueService) Send

func (s *DevQueueService) Send(queue string, task sdk.NitricTask) error

func (*DevQueueService) SendBatch

func (s *DevQueueService) SendBatch(queue string, tasks []sdk.NitricTask) (*sdk.SendBatchResponse, error)

type StorageDriver

type StorageDriver interface {
	EnsureDirExists(string) error
	ExistsOrFail(string) error
	WriteFile(string, []byte, os.FileMode) error
	ReadFile(string) ([]byte, error)
	DeleteFile(string) error
}

StorageDriver - The interface used by the LocalStorage plugin to write/read files from the local file system

Jump to

Keyboard shortcuts

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