util

package
v0.0.0-...-8ffd201 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageEOF = math.MinInt32
	BufferSize = 1024 * 512
)

Variables

This section is empty.

Functions

func CopyBuffer

func CopyBuffer(src io.Reader, dst io.Writer) (err error)

func ReadMessage

func ReadMessage(reader io.Reader) (res []byte, err error)

func ReadObject

func ReadObject(reader io.Reader, obj interface{}) error

func WriteEOFMessage

func WriteEOFMessage(writer io.Writer) (err error)

func WriteMessage

func WriteMessage(writer io.Writer, msg []byte) (err error)

func WriteObject

func WriteObject(writer io.Writer, obj interface{}) error

Types

type Heap

type Heap struct {
	Items    []*Item
	AgentMap map[string]*pb.Location
}

func NewHeap

func NewHeap() *Heap

func (*Heap) GetExecutorLoc

func (h *Heap) GetExecutorLoc() *pb.Location

func (*Heap) HasExecutor

func (h *Heap) HasExecutor() bool

func (*Heap) Len

func (h *Heap) Len() int

func (*Heap) Less

func (h *Heap) Less(i, j int) bool

func (*Heap) Pop

func (h *Heap) Pop() interface{}

func (*Heap) Push

func (h *Heap) Push(item interface{})

func (*Heap) Swap

func (h *Heap) Swap(i, j int)

type Item

type Item struct {
	Location       *pb.Location
	ExecutorNumber int
}

func NewItem

func NewItem(loc *pb.Location, num int) *Item

Jump to

Keyboard shortcuts

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