name

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

Documentation

Index

Constants

View Source
const (

	// HandlerDocumentType is a reserved internal document type
	// use for special handler related documents
	HandlerDocumentType = InternalPrefix + "-handler"

	// HandlerRequeueProperty is used to signal that all listeners
	// of the given handler should trigger a change. This is used if
	// the handler code was changed and now all data must be processed again.
	HandlerRequeueProperty = "requeue"
)
View Source
const (

	// InternalPrefix is the prefix that each internal
	// document type must have.
	InternalPrefix = "jb"
)

Variables

View Source
var (

	// ErrDocTypeNameReserved indicates that a reserved name was used
	// as a document type name.
	ErrDocTypeNameReserved = fmt.Errorf("document type which starts with %q is reserved", InternalPrefix)

	// ErrDocTypeNameInternal indicates that a document type that is
	ErrDocTypeNameInternal = fmt.Errorf("internal document type must has %q as a prefix", InternalPrefix)

	// ErrDocTypeNameInvalid indicates that the document type name is not valid
	// (e.g. contains invalid characters).
	ErrDocTypeNameInvalid = fmt.Errorf("document type must match pattern %q", docTypePatternRaw)
)
View Source
var (

	// ErrHandlerNameInvalid indicates that the handler name is not valid
	// (e.g. contains invalid characters).
	ErrHandlerNameInvalid = fmt.Errorf("handler must match pattern %q", handlerPatternRaw)
)

Functions

func CheckDocTypeName

func CheckDocTypeName(docType string, internal bool) error

CheckDocTypeName checks if a docType name is valid

func CheckHandlerName

func CheckHandlerName(handler string) error

CheckHandlerName checks if the handler name is valid

func CreateDocName

func CreateDocName(docType, name string) string

CreateDocName creates a document name based of docType and docName

func CreateListenerName

func CreateListenerName(handler, name string) string

CreateListenerName creates a unique listener name for a given handler.

func IsDocTypeInternal

func IsDocTypeInternal(docType string) bool

IsDocTypeInternal checks if a document type is a internal reserved one.

func ParseDocName

func ParseDocName(name string) (docType, docName string, err error)

ParseDocName parses a DocName into docType and docName

func ParseListenerName

func ParseListenerName(listener string) (string, string)

ParseListenerName returns the handler of a listener.

Types

This section is empty.

Jump to

Keyboard shortcuts

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