common

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PulsarTubeType = "pulsar"
	MemoryTubeType = "memory"
	HttpTubeType   = "http"

	WASMRuntime = "wasm"

	RuntimeArchiveConfigKey = "archive"

	StateStorePebble = "pebble"
)

Variables

View Source
var (
	ErrorFunctionNotFound       = errors.New("function not found")
	ErrorFunctionExists         = errors.New("function already exists")
	ErrorTubeFactoryNotFound    = errors.New("tube factory not found")
	ErrorRuntimeFactoryNotFound = errors.New("runtime factory not found")
)

Functions

func Expensive

func Expensive(f func() slog.Value) slog.LogValuer

func LogCounter

func LogCounter() slog.LogValuer

func OptionalStr

func OptionalStr(s string) *string

func ReceiveFromChannel

func ReceiveFromChannel[T any](ctx context.Context, c <-chan T) (T, bool)

func RunProcess

func RunProcess(startProcess func() (io.Closer, error))

func SendToChannel

func SendToChannel[T any](ctx context.Context, c chan<- T, e interface{}) bool

func WaitUntilSignal

func WaitUntilSignal(closers ...io.Closer)

Types

type BufferReader

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

func NewChanReader

func NewChanReader() *BufferReader

func (*BufferReader) Read

func (r *BufferReader) Read(p []byte) (n int, err error)

func (*BufferReader) ResetBuffer

func (r *BufferReader) ResetBuffer(data []byte)

type BufferWriter

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

func NewChanWriter

func NewChanWriter() *BufferWriter

func (*BufferWriter) GetAndReset

func (w *BufferWriter) GetAndReset() []byte

func (*BufferWriter) Write

func (w *BufferWriter) Write(p []byte) (n int, err error)

type ConfigMap added in v0.4.0

type ConfigMap map[string]interface{}

func MergeConfig added in v0.4.0

func MergeConfig(configs ...*ConfigMap) *ConfigMap

MergeConfig merges multiple ConfigMap into one

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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