primitives

package
v1.24.0-m112.2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 6 Imported by: 10

README

The primitives package is meant to contain definitions and constants that are widely used throughout this repository.

There should serve as the root package in that there should be no imports of any other Temporal package.

Documentation

Index

Constants

View Source
const (
	// GetHistoryMaxPageSize is the max page size for get history
	GetHistoryMaxPageSize = 256
	// ReadDLQMessagesPageSize is the max page size for read DLQ messages
	ReadDLQMessagesPageSize = 1000
)
View Source
const (
	// SystemLocalNamespace is namespace name for temporal system workflows running in local cluster
	SystemLocalNamespace = "temporal-system"
	// SystemNamespaceID is namespace id for all temporal system workflows
	SystemNamespaceID = "32049b68-7872-4094-8e63-d0dd59896a83"
	// SystemNamespaceRetention is retention config for all temporal system workflows
	SystemNamespaceRetention = time.Hour * 24 * 7
)

This was flagged by salus as potentially hardcoded credentials. This is a false positive by the scanner and should be disregarded. #nosec

View Source
const (
	DefaultWorkerTaskQueue = "default-worker-tq"
	PerNSWorkerTaskQueue   = "temporal-sys-per-ns-tq"

	MigrationActivityTQ           = "temporal-sys-migration-activity-tq"
	AddSearchAttributesActivityTQ = "temporal-sys-add-search-attributes-activity-tq"
	DeleteNamespaceActivityTQ     = "temporal-sys-delete-namespace-activity-tq"
	DLQActivityTQ                 = "temporal-sys-dlq-activity-tq"
)

These are task queue names for internal task queues.

View Source
const (
	DefaultHistoryMaxAutoResetPoints = 20
)
View Source
const (
	// DefaultTransactionSizeLimit is the largest allowed transaction size to persistence
	DefaultTransactionSizeLimit = 4 * 1024 * 1024
)
View Source
const (
	// DefaultWorkflowTaskTimeout sets the Default Workflow Task timeout for a Workflow
	DefaultWorkflowTaskTimeout = 10 * time.Second * debug.TimeoutMultiplier
)

Variables

This section is empty.

Functions

func MustValidateUUID

func MustValidateUUID(s string) string

MustValidateUUID parses and validates UUID contents from the given string representation returns empty string if the input is empty string panics if the given input is malformed

func UUIDString

func UUIDString(b []byte) string

func ValidateUUID

func ValidateUUID(s string) (string, error)

ValidateUUID parses and validates UUID contents from the given string representation returns:

  • nil if the input is empty string
  • error if input is malformed
  • input if input can be parsed and is valid

Types

type ServiceName added in v1.20.0

type ServiceName string
const (
	AllServices             ServiceName = "all"
	FrontendService         ServiceName = "frontend"
	InternalFrontendService ServiceName = "internal-frontend"
	HistoryService          ServiceName = "history"
	MatchingService         ServiceName = "matching"
	WorkerService           ServiceName = "worker"
	ServerService           ServiceName = "server"
	UnitTestService         ServiceName = "unittest"
)

These constants represent service roles

type UUID

type UUID []byte

UUID represents a 16-byte universally unique identifier this type is a wrapper around google/uuid with the following differences

  • type is a byte slice instead of [16]byte
  • db serialization converts uuid to bytes as opposed to string

func MustParseUUID

func MustParseUUID(s string) UUID

MustParseUUID returns a UUID parsed from the given string representation returns nil if the input is empty string panics if the given input is malformed

func NewUUID

func NewUUID() UUID

NewUUID generates a new random UUID

func ParseUUID

func ParseUUID(s string) (UUID, error)

ParseUUID returns a UUID parsed from the given string representation returns:

  • nil if the input is empty string
  • error if input is malformed
  • UUID object if input can be parsed and is valid

func UUIDPtr

func UUIDPtr(u UUID) *UUID

UUIDPtr simply returns a pointer for the given value type

func (UUID) Downcast

func (u UUID) Downcast() []byte

Downcast returns the UUID as a byte slice. This is necessary when passing to type sensitive interfaces such as cql.

func (*UUID) Scan

func (u *UUID) Scan(src interface{}) error

Scan implements sql.Scanner interface to allow this type to be parsed transparently by database drivers

func (UUID) String

func (u UUID) String() string

String returns the 36 byte hexstring representation of this uuid return empty string if this uuid is nil

func (UUID) StringPtr

func (u UUID) StringPtr() *string

StringPtr returns a pointer to the 36 byte hexstring representation of this uuid return empty string if this uuid is nil

func (UUID) Value

func (u UUID) Value() (driver.Value, error)

Value implements sql.Valuer so that UUIDs can be written to databases transparently. This method returns a byte slice representation of uuid

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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