Documentation
¶
Index ¶
- Constants
- Variables
- func AdminCommands(ctx context.Context, registry jsonball.Registry, detector propchange.Detector, ...) error
- func GetDocumentContent(ctx context.Context, registry jsonball.Registry, docType, docName string) (d event.Document, err error)
- func HandleChange(ctx context.Context, registry jsonball.Registry, change propchange.OnChange) (*event.Change, error)
- func HandlerNewDoc(ctx context.Context, registry jsonball.Registry, detector propchange.Detector, ...) error
- func Listen(ctx context.Context, detector propchange.Detector, listen event.ListenOnChange) error
- func PutDocument(ctx context.Context, docRegistry jsonball.Registry, ...) error
- func QueueDocument(ctx context.Context, sqsClient *sqs.Client, queueURL string, ...) error
- func RegisterDocumentType(ctx context.Context, registry jsonball.Registry, docType string) error
- func RegisterDocumentTypeInternal(ctx context.Context, registry jsonball.Registry, docType string) error
- func RegisterHandler(ctx context.Context, registry jsonball.Registry, detector propchange.Detector, ...) error
- func RequeueDoc(ctx context.Context, registry jsonball.Registry, detector propchange.Detector, ...) error
- func RequeueHandler(ctx context.Context, detector propchange.Detector, handler string) error
Constants ¶
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 ¶
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") )
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 ¶
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 RequeueHandler ¶
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.