service

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

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

Go to latest
Published: Jan 25, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewValidationError

func NewValidationError(msg string) error

Types

type PodService

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

func NewPodService

func NewPodService(client kubernetes.Interface) *PodService

func (*PodService) Create

func (s *PodService) Create(namespace string, pod *corev1.Pod) (*corev1.Pod, error)

创建Pod

func (*PodService) Delete

func (s *PodService) Delete(namespace, name string) error

删除Pod

func (*PodService) Get

func (s *PodService) Get(namespace, name string) (*corev1.Pod, error)

获取单个Pod

func (*PodService) List

func (s *PodService) List(namespace, selector string, limit int64) (*corev1.PodList, error)

列表查询(支持分页和标签过滤)

func (*PodService) Update

func (s *PodService) Update(namespace string, pod *corev1.Pod) (*corev1.Pod, error)

更新Pod(包含冲突检测)

func (*PodService) Watch

func (s *PodService) Watch(namespace, selector string) (watch.Interface, error)

Watch机制实现

type ValidationError

type ValidationError struct {
	Message string
}

自定义错误类型

func (*ValidationError) Error

func (e *ValidationError) Error() string

Jump to

Keyboard shortcuts

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