Documentation
¶
Index ¶
- Constants
- Variables
- type Collection
- func (c *Collection[T]) AddItem(lg *log.Logger) int
- func (c *Collection[T]) Collect(id int)
- func (c *Collection[T]) CollectAll()
- func (c *Collection[T]) Item(id int) *Item[T]
- func (c *Collection[T]) Next() int
- func (c *Collection[T]) OnCollect(fn func(i *Item[T])) *Collection[T]
- func (c *Collection[T]) Schedule(id int, tk *Task[T]) <-chan struct{}
- func (c *Collection[T]) ScheduleAll(tk *Task[T]) <-chan struct{}
- func (c *Collection[T]) TaskCount() (int, bool)
- type CollectionType
- type Crate
- type CrateItem
- type Item
- type ItemContext
- type ItemFile
- type ItemImage
- type ItemQR
- type ItemSelf
- type ItemTask
- type RefItem
- type Task
Constants ¶
View Source
const TASK_QUEUE_SIZE = 64
Variables ¶
View Source
var CollectionList = []CollectionType{ TYPE_TASK, TYPE_IMAGE, TYPE_FILE, TYPE_CONTEXT, TYPE_QR, }
Functions ¶
This section is empty.
Types ¶
type Collection ¶
func NewCollection ¶
func NewCollection[T ItemSelf](lg *log.Logger) *Collection[T]
func (*Collection[T]) Collect ¶
func (c *Collection[T]) Collect(id int)
func (*Collection[T]) CollectAll ¶
func (c *Collection[T]) CollectAll()
func (*Collection[T]) Item ¶
func (c *Collection[T]) Item(id int) *Item[T]
func (*Collection[T]) Next ¶
func (c *Collection[T]) Next() int
func (*Collection[T]) OnCollect ¶
func (c *Collection[T]) OnCollect(fn func(i *Item[T])) *Collection[T]
func (*Collection[T]) Schedule ¶
func (c *Collection[T]) Schedule(id int, tk *Task[T]) <-chan struct{}
func (*Collection[T]) ScheduleAll ¶
func (c *Collection[T]) ScheduleAll(tk *Task[T]) <-chan struct{}
func (*Collection[T]) TaskCount ¶
func (c *Collection[T]) TaskCount() (int, bool)
type CollectionType ¶
type CollectionType int
const ( TYPE_TASK CollectionType = iota TYPE_IMAGE TYPE_FILE TYPE_CONTEXT TYPE_QR )
type Item ¶
type ItemContext ¶
func (ItemContext) Identifier ¶
func (context ItemContext) Identifier() CollectionType
type ItemFile ¶
func (ItemFile) Identifier ¶
func (file ItemFile) Identifier() CollectionType
type ItemImage ¶
type ItemImage struct {
Image image.Image
Name string
Encoding imageutil.ImageEncoding
Model imageutil.ColorModel
}
func (ItemImage) Identifier ¶
func (img ItemImage) Identifier() CollectionType
type ItemQR ¶
func (ItemQR) Identifier ¶
func (qr ItemQR) Identifier() CollectionType
type ItemSelf ¶
type ItemSelf interface {
Identifier() CollectionType
}
type ItemTask ¶
type ItemTask struct {
Name string
}
func (ItemTask) Identifier ¶
func (qr ItemTask) Identifier() CollectionType
Click to show internal directories.
Click to hide internal directories.