operation

package
v0.0.0-...-c5a58e0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AdminCmdRegisterDocType is used to register a new document type
	AdminCmdRegisterDocType = "regDocType"

	// AdminCmdRegisterHandler is used to register a new handler
	AdminCmdRegisterHandler = "regHandler"

	// AdminCmdRequeueHandler is used to requeue all listeners of a handler
	AdminCmdRequeueHandler = "requeueHandler"

	// AdminCmdHandlerNewDoc is used to make sure that a handler is called for
	// a new document of a given type.
	AdminCmdHandlerNewDoc = "handlerNewDoc"

	// AdminCmdRequeueDoc is used to trigger all handlers that listen
	// for a specific document
	AdminCmdRequeueDoc = "requeueDoc"

	// AdminCmdAssignDoc is used to assign a document to a handler
	AdminCmdAssignDoc = "assignDoc"

	// AdminCmdAssignDocs is used to assign documents to a handler
	AdminCmdAssignDocs = "assignDocs"
)

Variables

View Source
var (
	// ErrInvalidCommand indicates that the given command is invalid.
	ErrInvalidCommand = errors.New("given command is not a valid admin command")

	// ErrCommandDataMissing indicates that either the complete command is missing
	// or that some data of the command is missing.
	ErrCommandDataMissing = errors.New("command data missing")
)
View Source
var ErrQueueIsNotFIFO = errors.New("target queue should be a FIFO queue")

ErrQueueIsNotFIFO indicates that the target queue is not a FIFO queue

Functions

func AdminCommands

func AdminCommands(ctx context.Context, registry jsonball.Registry, detector propchange.Detector, adminCmd *event.AdminCmd) error

AdminCommands executes simple administrative commands

func GetDocumentContent

func GetDocumentContent(ctx context.Context, registry jsonball.Registry, docType, docName string) (d event.Document, err error)

GetDocumentContent gets the actual content of a document

func HandleChange

func HandleChange(ctx context.Context, registry jsonball.Registry, change propchange.OnChange) (*event.Change, error)

HandleChange handles an open change -> loads affected documents

func HandlerNewDoc

func HandlerNewDoc(ctx context.Context, registry jsonball.Registry, detector propchange.Detector, handerNewDoc *event.HandlerNewDoc) error

func Listen

func Listen(ctx context.Context, detector propchange.Detector, listen event.ListenOnChange) error

Listen adds a listener that listens to changes of properties

func PutDocument

func PutDocument(ctx context.Context, docRegistry jsonball.Registry, detector propchange.Detector, docType, docName string, doc interface{}) error

PutDocument identifies changes of document and updates tha properties revision to later find changes

func QueueDocument

func QueueDocument(ctx context.Context, sqsClient *sqs.Client, queueURL string, doc event.PostDocument) error

QueueDocument queues a document which needs to be proccessed

func RegisterDocumentType

func RegisterDocumentType(ctx context.Context, registry jsonball.Registry, docType string) error

RegisterDocumentType registers a new document type

func RegisterDocumentTypeInternal

func RegisterDocumentTypeInternal(ctx context.Context, registry jsonball.Registry, docType string) error

RegisterDocumentTypeInternal registers a new internal document type. This function should only be used to register internal (reserved) document types. Don't use this for regular document types.

func RegisterHandler

func RegisterHandler(ctx context.Context, registry jsonball.Registry, detector propchange.Detector, handler *event.RegisterHandler) error

RegisterHandler registers a new handler

func RequeueDoc

func RequeueDoc(ctx context.Context, registry jsonball.Registry, detector propchange.Detector, docType, docName string) error

func RequeueHandler

func RequeueHandler(ctx context.Context, detector propchange.Detector, handler string) error

RequeueHandler requeue all listeners of the given handler. This is used if the handler code changed and the handler needs to process all data again.

Types

This section is empty.

Jump to

Keyboard shortcuts

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