packager

package
v0.0.0-...-897372c Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

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

func (*Action) ID

func (a *Action) ID() uint32

func (*Action) State

func (a *Action) State() uint32

type Checker

type Checker interface {
	// Should tell or not
	// 0: it should be cancelled
	// 1~: state of this information
	Check(id uint32) uint32
}

type Package

type Package struct {
	PackageOp
	PackageCtrl
	// contains filtered or unexported fields
}

func NewPackage

func NewPackage(
	size int,
	checker Checker,
	setchecker SetChecker,
) *Package

func NewPackageWithLockStep

func NewPackageWithLockStep(
	size int,
	lock lockstep.LockStepOperator,
	checker Checker,
	setchecker SetChecker,
) *Package

func (*Package) Add

func (p *Package) Add(id uint32)

func (*Package) Complete

func (p *Package) Complete(index int)

func (*Package) Drop

func (p *Package) Drop(index int)

func (*Package) Remove

func (p *Package) Remove(id uint32)

func (*Package) Update

func (p *Package) Update(
	actions []Action,
) (int, int)

Retrieve Update Actions -> actionSize, index check

type PackageCtrl

type PackageCtrl interface {
	Add(id uint32)
	Remove(id uint32)
}

type PackageOp

type PackageOp interface {
	Update(actions []Action) (int, int)
	Complete(index int)
	Drop(index int)
}

type SetChecker

type SetChecker interface {
	Check(ids []uint32) int
}

type SizeChecker

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

func (*SizeChecker) Check

func (c *SizeChecker) Check(ids []uint32) int

type SizePackage

type SizePackage struct {
	*Package
}

func NewSizePackage

func NewSizePackage(
	size int,
	checker Checker,
) *SizePackage

type SizedPackage

type SizedPackage struct {
	*Package
	// contains filtered or unexported fields
}

func NewSizedPackage

func NewSizedPackage(
	maxSize int,
	maxWeight int,
	check func(id uint32) uint32,
	wvGetter func(id uint32) (uint, uint, bool),
) *SizedPackage

Jump to

Keyboard shortcuts

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