cache

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JobKey

func JobKey(job *v1alpha1.Job) string

JobKey gets the "ns"/"name" format of the given job.

func JobKeyByName

func JobKeyByName(namespace string, name string) string

JobKeyByName gets the key for the job name.

func JobKeyByReq

func JobKeyByReq(req *apis.Request) string

JobKeyByReq gets the key for the job request.

Types

type Cache

type Cache interface {
	Run(stopCh <-chan struct{})

	Get(key string) (*apis.JobInfo, error)
	GetStatus(key string) (*v1alpha1.JobStatus, error)
	Add(obj *v1alpha1.Job) error
	Update(obj *v1alpha1.Job) error
	Delete(obj *v1alpha1.Job) error

	AddPod(pod *v1.Pod) error
	UpdatePod(pod *v1.Pod) error
	DeletePod(pod *v1.Pod) error

	TaskCompleted(jobKey, taskName string) bool
	TaskFailed(jobKey, taskName string) bool
}

Cache Interface.

func New

func New() Cache

New gets the job Cache.

Jump to

Keyboard shortcuts

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