util

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertFromProto

func ConvertFromProto(data map[string]*structpb.Value) map[string]any

func ConvertMapToStructPb

func ConvertMapToStructPb(data map[string]any) *structpb.Value

func ConvertToProto

func ConvertToProto(data map[string]any) map[string]*structpb.Value

func ResolveInputParams

func ResolveInputParams(flowContext *model.FlowContext, inputParams map[string]any) map[string]any

func Shuffle

func Shuffle(in []int)

Types

type Action

type Action any

type EncoderDecoder

type EncoderDecoder[T any] interface {
	Encode(value T) ([]byte, error)
	Decode(data []byte) (*T, error)
}

type JsonEncDec

type JsonEncDec[T any] struct{}

func NewJsonEncoderDecoder

func NewJsonEncoderDecoder[T any]() *JsonEncDec[T]

func (*JsonEncDec[T]) Decode

func (encdec *JsonEncDec[T]) Decode(data []byte) (*T, error)

func (*JsonEncDec[T]) Encode

func (encdec *JsonEncDec[T]) Encode(value T) ([]byte, error)

type TickWorker

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

func NewTickWorker

func NewTickWorker(name string, interval time.Duration, stop chan struct{}, fn func(), wg *sync.WaitGroup) *TickWorker

func (*TickWorker) IsRunning

func (tw *TickWorker) IsRunning() bool

func (*TickWorker) Start

func (tw *TickWorker) Start()

func (*TickWorker) Stop

func (tw *TickWorker) Stop()

type Worker

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

func NewWorker

func NewWorker(name string, stop chan struct{}, handler func() bool, wg *sync.WaitGroup) *Worker

func (*Worker) IsRunning

func (w *Worker) IsRunning() bool

func (*Worker) Start

func (w *Worker) Start()

func (*Worker) Stop

func (w *Worker) Stop()

Jump to

Keyboard shortcuts

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