mysql

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	ID   uint64
	Type uint64
	Name string

	RegisteredAt *time.Time
	RefreshedAt  *time.Time
	// contains filtered or unexported fields
}

Document is an open document

func (*Document) Change

func (d *Document) Change(change jsonball.Change) error

Change updates a document

func (*Document) Close

func (d *Document) Close() error

Close coloses the current document. No further operation are possible

func (*Document) Document

func (d *Document) Document() string

Document gets the current document

func (*Document) IsNew

func (d *Document) IsNew() bool

IsNew tells whether the document is a new one

func (*Document) Refresh

func (d *Document) Refresh() error

Refresh marks the document as up-to-date even no ne changed was happened

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry is a registry with a mysql backend

func NewRegistry

func NewRegistry(cs string, key []byte) (*Registry, error)

NewRegistry opens a registry based on a connection string

func (*Registry) GetDocument

func (r *Registry) GetDocument(ctx context.Context, docType, name string) (string, error)

GetDocument gets the current document content

func (*Registry) GetHandlerQueueURL

func (r *Registry) GetHandlerQueueURL(ctx context.Context, name string) (url string, err error)

GetHandlerQueueURL get the queue URL of an given handler

func (*Registry) GetNewDocHanders

func (r *Registry) GetNewDocHanders(ctx context.Context, docType string) ([]string, error)

GetNewDocHanders gets handlers that want to handle new document of a given type

func (*Registry) HandlerNewDoc

func (r *Registry) HandlerNewDoc(ctx context.Context, handler, docType string, register bool) error

func (*Registry) ListDocuments

func (r *Registry) ListDocuments(ctx context.Context, docType, startToken string, maxDocs uint16) (*jsonball.DocumentList, error)

ListDocuments lists documents of a given type

func (*Registry) OpenDocument

func (r *Registry) OpenDocument(ctx context.Context, docType, name string) (jsonball.DocOps, error)

OpenDocument opens a new or existing document.

func (*Registry) RegisterDocumentType

func (r *Registry) RegisterDocumentType(ctx context.Context, docType string) error

RegisterDocumentType registers a new document type

func (*Registry) RegisterHandler

func (r *Registry) RegisterHandler(ctx context.Context, handler *event.RegisterHandler) error

RegisterHandler registers a new handler

Jump to

Keyboard shortcuts

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