common

package
v0.0.0-...-5ab7537 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChunkSlice

func ChunkSlice[T interface{}](slice []T, chunkSize int) [][]T

func ConvertToStrings

func ConvertToStrings(row []interface{}) []string

Types

type Action

type Action int
const (
	TAKE  Action = iota + 1 // EnumIndex = 1
	COUNT                   // EnumIndex = 3
)

func (Action) EnumIndex

func (d Action) EnumIndex() int

func (Action) String

func (d Action) String() string

type Future

type Future[T interface{}] interface {
	Await() T
}

Future interface has the method signature for await

func Exec

func Exec[T interface{}](f func() T) Future[any]

Exec executes the async function

type IPluginContract

type IPluginContract interface {
	//Plugin Name
	Name() string
	//Master Read planning
	Plan(args ...interface{}) []*protos.Task
	//set configs
	Configs(map[string]string) IPluginContract
	//runtime
	Execute(*protos.Task) *protos.TaskResult
}

type LinkedList

type LinkedList[T any] struct {
	// contains filtered or unexported fields
}

LinkedList implements a pointer-linked list with a head and tail.

The empty value is a valid empty linked list.

func NewLinkedList

func NewLinkedList[T any](elems ...T) *LinkedList[T]

NewLinkedList constructs a new LinkedList.

func (*LinkedList[T]) IsEmpty

func (l *LinkedList[T]) IsEmpty() bool

IsEmpty checks if the linked list is empty.

func (*LinkedList[T]) Peek

func (l *LinkedList[T]) Peek() (T, bool)

Peek peeks the head of the linked list.

func (*LinkedList[T]) PeekTail

func (l *LinkedList[T]) PeekTail() (T, bool)

PeekTail peeks the tail of the linked list.

func (*LinkedList[T]) Pop

func (l *LinkedList[T]) Pop() (T, bool)

Pop dequeues the head of the linked list.

func (*LinkedList[T]) Push

func (l *LinkedList[T]) Push(val T)

Push pushes a value to the end of the linked list.

func (*LinkedList[T]) PushFront

func (l *LinkedList[T]) PushFront(val T)

PushFront pushes a value to the front of the linked list. It will be returned next for Pop or Peek.

func (*LinkedList[T]) Reset

func (l *LinkedList[T]) Reset()

Reset clears the linked list.

type Maplan

type Maplan struct {
	Action Action
	Plan   Planner
	Tasks  []*protos.Task
}

type Options

type Options struct {
}

type Planner

type Planner int
const (
	LIMIT Planner = iota + 1 // EnumIndex = 1
	LOAD                     // EnumIndex = 2
)

func (Planner) EnumIndex

func (d Planner) EnumIndex() int

func (Planner) String

func (d Planner) String() string

Jump to

Keyboard shortcuts

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