queue

package
v0.0.0-...-b81b3d3 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PolicyQueue = &Queue[PolicyQueueHandle]{
	queue: queue.New(),
}

PolicyQueue 存放待处理policy队列

View Source
var TaskQueue = &Queue[TaskQueueHandle]{
	queue: queue.New(),
}

Functions

This section is empty.

Types

type PolicyQueueHandle

type PolicyQueueHandle struct {
	ID       uint   `json:"id"`
	HandleID string `json:"handle_id"`
}

type Queue

type Queue[T PolicyQueueHandle | TaskQueueHandle] struct {
	// contains filtered or unexported fields
}

func (*Queue[T]) List

func (c *Queue[T]) List() (ret []T)

func (*Queue[T]) Pop

func (c *Queue[T]) Pop() (T, bool)

func (*Queue[T]) Push

func (c *Queue[T]) Push(item T) (ok bool)

type TaskQueueHandle

type TaskQueueHandle struct {
	ID       uint   `json:"id"`
	PolicyID uint   `json:"policy_id"`
	HandleID string `json:"handle_id"`
}

Jump to

Keyboard shortcuts

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