utils

package
v0.0.0-...-a2bc6c4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MetadataTopicID = UUID{0, 1}

MetadataTopicID is a UUID for the metadata topic in KRaft mode. It will never be returned by the randomUUID function.

View Source
var ZeroUUID = UUID{0, 0}

ZeroUUID represents a null or empty UUID. It will never be returned by the randomUUID function.

Functions

func HandleStringLiteral

func HandleStringLiteral(item string) string

The value is either a quoted string with escaped characters, or an unescaped string without quotes. We need to strip the quotes and unescape the string.

func ReadFileUpward

func ReadFileUpward(relPath string, verbose bool) ([]byte, error)

func StatUpward

func StatUpward(relPath string, verbose bool) (os.FileInfo, string, error)

Types

type BaseWaiter

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

func (*BaseWaiter) Wait

func (bw *BaseWaiter) Wait(w Waiter) error

type KafkaWaiter

type KafkaWaiter struct {
	BaseWaiter
	// contains filtered or unexported fields
}

func NewKafkaWaiter

func NewKafkaWaiter(broker string, opts ...WaiterOption) *KafkaWaiter

func (*KafkaWaiter) CheckHealth

func (kw *KafkaWaiter) CheckHealth() (bool, error)

func (*KafkaWaiter) Wait

func (kw *KafkaWaiter) Wait() error

type LocalStackWaiter

type LocalStackWaiter struct {
	BaseWaiter
	// contains filtered or unexported fields
}

func NewLocalStackWaiter

func NewLocalStackWaiter(endpoint string, opts ...WaiterOption) *LocalStackWaiter

func (*LocalStackWaiter) CheckHealth

func (lw *LocalStackWaiter) CheckHealth() (bool, error)

func (*LocalStackWaiter) Wait

func (lw *LocalStackWaiter) Wait() error

type PortWaiter

type PortWaiter struct {
	BaseWaiter
	// contains filtered or unexported fields
}

func NewPortWaiter

func NewPortWaiter(port string, options ...WaiterOption) *PortWaiter

func (*PortWaiter) CheckHealth

func (pw *PortWaiter) CheckHealth() (bool, error)

func (*PortWaiter) Wait

func (pw *PortWaiter) Wait() error

type UUID

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

UUID represents a universally unique identifier (UUID).

func (UUID) String

func (u UUID) String() string

String returns a base64 URL-safe encoding of the UUID without padding.

type Waiter

type Waiter interface {
	Wait() error
	CheckHealth() (bool, error)
}

type WaiterOption

type WaiterOption func(*BaseWaiter)

func WithInterval

func WithInterval(interval time.Duration) WaiterOption

func WithTimeout

func WithTimeout(timeout time.Duration) WaiterOption

Jump to

Keyboard shortcuts

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