Documentation
¶
Index ¶
- Variables
- func AnyQueue() workflow.Queue
- func BuildOptionArgs(options map[string]string) []string
- func Clean(s string) string
- func ClonePointer[T any](v *T) *T
- func FromPointer[T comparable](v *T) T
- func HostQueue(hostID string) workflow.Queue
- func ManagerQueue() workflow.Queue
- func NillablePointerTo[T comparable](v T) *T
- func PointerTo[T any](v T) *T
- func RandomString(length int) (string, error)
- func Retry(maxAttempts int, initialDelay time.Duration, f func() error) error
- func ValidateID(value string) error
- func WithTimeout(ctx context.Context, timeout time.Duration, f func(ctx context.Context) error) error
- type LineWriter
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidIdentifier = errors.New(`valid IDs must be 1-63 characters long, contain only lower-cased letters and hyphens, start and end with a letter or number, and not contain two consecutive hyphens`)
var ErrTimedOut = errors.New("operation timed out")
Functions ¶
func BuildOptionArgs ¶
func ClonePointer ¶
func ClonePointer[T any](v *T) *T
func FromPointer ¶
func FromPointer[T comparable](v *T) T
FromPointer dereferences the input pointer if it's non-nil or returns the zero value for T if the pointer is nil.
func ManagerQueue ¶
func NillablePointerTo ¶
func NillablePointerTo[T comparable](v T) *T
NillablePointerTo returns a pointer to v if v is not the zero value of its type, otherwise it returns nil.
func RandomString ¶
func Retry ¶
Retry retries the given function up to maxAttempts times with an exponential backoff starting at initialDelay.
func ValidateID ¶
Types ¶
type LineWriter ¶
type LineWriter struct {
// contains filtered or unexported fields
}
LineWriter is an io.Writer that buffers input until a newline is seen. When a newline is encountered, it calls the provided emit function with the line (without the newline).
func NewLineWriter ¶
func NewLineWriter(emit func([]byte) error) *LineWriter
NewLineWriter creates a new LineWriter with the given emit function. The emit function is called whenever a full line is buffered (newline is removed).
func (*LineWriter) Close ¶
func (w *LineWriter) Close() error
Close forces the buffered data to be emitted, even if no newline is present.