service

package
v0.0.0-...-0b4b916 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

Functions

func DeletePod

func DeletePod(ns string, podName string) (bool, error)

func GetDeploymentCondition

func GetDeploymentCondition(dep *v1.Deployment) string

func GetDeploymentIsComplete

func GetDeploymentIsComplete(dep *v1.Deployment) bool

func GetImages

func GetImages(dep v1.Deployment) string

func GetImagesByPod

func GetImagesByPod(container []corev1.Container) string

func GetLabels

func GetLabels(m map[string]string) string

func GetPodIsReady

func GetPodIsReady(pod corev1.Pod) bool

func GetPodMessage

func GetPodMessage(pod corev1.Pod) string

func GetrslablebydeploymentListWatch

func GetrslablebydeploymentListWatch(dep v1.Deployment, rslist []*v1.ReplicaSet) ([]map[string]string, error)

取出跟dep match的所有 rs,而不是最新的。 解决 2/1/1的问题;

func IncreaseReplicas

func IncreaseReplicas(ns string, dep string, dec bool) (bool, error)

func IsCurrentRsByDep

func IsCurrentRsByDep(dep v1.Deployment, set v1.ReplicaSet) bool

func IsRsFromDep

func IsRsFromDep(dep v1.Deployment, set v1.ReplicaSet) bool

判断 rs 是否属于某个dep,而不是判断它是最新的。 因此,得调用这个,才能解决 2/1/1的问题;

func RenderPods

func RenderPods(pods []*corev1.Pod) []*PodModel2.PodImpl

Types

type ConfigmapService

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

func ProviderConfigmapService

func ProviderConfigmapService(configmapRepo *repo.ConfigMapRepo) *ConfigmapService

func (*ConfigmapService) GetAll

func (this *ConfigmapService) GetAll(ns string) *result.ErrorResult

type DeploymentService

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

func ProviderDeploymentService

func ProviderDeploymentService(rsRepo *repo.RsRep, podRepo *repo.PodRepo, deploymentRepo *repo.DeploymentRepo, nsRepo *repo.NamespaceRepo, podService *PodService) *DeploymentService

func (*DeploymentService) DeletePod

func (this *DeploymentService) DeletePod(ns string, pod string) *result.ErrorResult

func (*DeploymentService) GetDeploymentDetailByNsDName

func (this *DeploymentService) GetDeploymentDetailByNsDName(ns string, dname string) *result.ErrorResult

func (*DeploymentService) GetDeploymentsByNs

func (this *DeploymentService) GetDeploymentsByNs(ns string) *result.ErrorResult

func (*DeploymentService) GetDeploymentsByNs2

func (this *DeploymentService) GetDeploymentsByNs2(ns string) (interface{}, error)

func (*DeploymentService) GetNs

func (this *DeploymentService) GetNs() *result.ErrorResult

func (*DeploymentService) GetPodContainer

func (this *DeploymentService) GetPodContainer(ns string, podName string) *result.ErrorResult

func (*DeploymentService) GetPodDetail

func (this *DeploymentService) GetPodDetail(ns string, pod string) *result.ErrorResult

func (*DeploymentService) GetPodJson

func (this *DeploymentService) GetPodJson(ns string, pod string) *result.ErrorResult

func (*DeploymentService) GetPodLogs

func (this *DeploymentService) GetPodLogs(c *gin.Context, ns string, podname string, cname string) *result.ErrorResult

func (*DeploymentService) GetPods

func (this *DeploymentService) GetPods(ns string, dname string) *result.ErrorResult

func (*DeploymentService) GetPodsByDep

func (this *DeploymentService) GetPodsByDep(dep v1.Deployment, ns string, dname string) []*PodModel2.PodImpl

func (*DeploymentService) IncrReplicas

func (this *DeploymentService) IncrReplicas(ns string, dep string, dec bool) *result.ErrorResult

func (*DeploymentService) ListPodsByLabels

func (this *DeploymentService) ListPodsByLabels(ns string, labels []map[string]string) []*PodModel2.PodImpl

type IDeployment

type IDeployment interface {
	GetDeploymentsByNs(ns string) *result.ErrorResult
	GetDeploymentsByNs2(ns string) (interface{}, error)
	IncrReplicas(ns string, dep string, dec bool) *result.ErrorResult
	GetDeploymentDetailByNsDName(ns string, dep string) *result.ErrorResult
	GetPods(ns string, dep string) *result.ErrorResult
	GetPodJson(ns string, pod string) *result.ErrorResult
	GetPodDetail(ns string, pod string) *result.ErrorResult
	DeletePod(ns string, pod string) *result.ErrorResult
	GetNs() *result.ErrorResult
	GetPodLogs(c *gin.Context, ns string, pod string, cname string) *result.ErrorResult
	GetPodContainer(ns string, podName string) *result.ErrorResult
}

type ISecret

type ISecret interface {
	GetSecretByNs(ns string) *result.ErrorResult
	PostSecret(secret *SecretModel.PostSecretModel, c *gin.Context) *result.ErrorResult
}

func NewSecretService

func NewSecretService(secretRepo *repo.SecretRepo) ISecret

type IUser

type IUser interface {
	GetUserList() []*UserModel.UserImpl
	GetUserDetail(id int64) *result.ErrorResult
	CreateUser(user *UserModel.UserImpl) *result.ErrorResult
	UpdateUser(id int, user *UserModel.UserImpl) *result.ErrorResult
	DeleteUser(id int) *result.ErrorResult
	SignIn(username string, password string) (*UserModel.UserImpl, error)
	SignUp(email string, username string, password string) error
}

type IUserServiceGetterImpl

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

func NewUserServiceImpl

func NewUserServiceImpl(userRepo repo.IUserRepo) *IUserServiceGetterImpl

func (*IUserServiceGetterImpl) CreateUser

func (this *IUserServiceGetterImpl) CreateUser(user *UserModel.UserImpl) *result.ErrorResult

func (*IUserServiceGetterImpl) DeleteUser

func (this *IUserServiceGetterImpl) DeleteUser(id int) *result.ErrorResult

func (*IUserServiceGetterImpl) GetUserDetail

func (this *IUserServiceGetterImpl) GetUserDetail(id int64) *result.ErrorResult

func (*IUserServiceGetterImpl) GetUserList

func (this *IUserServiceGetterImpl) GetUserList() []*UserModel.UserImpl

func (*IUserServiceGetterImpl) SignIn

func (this *IUserServiceGetterImpl) SignIn(username string, password string) (*UserModel.UserImpl, error)

func (*IUserServiceGetterImpl) SignUp

func (this *IUserServiceGetterImpl) SignUp(email string, username string, password string) error

func (*IUserServiceGetterImpl) UpdateUser

func (this *IUserServiceGetterImpl) UpdateUser(id int, user *UserModel.UserImpl) *result.ErrorResult

type PodService

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

func ProviderPodService

func ProviderPodService(podRepo *repo.PodRepo) *PodService

func (*PodService) GetPodContainer

func (this *PodService) GetPodContainer(ns, podname string) []*model.ContainerModel

type SecretService

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

func (*SecretService) GetSecretByNs

func (this *SecretService) GetSecretByNs(ns string) *result.ErrorResult

func (*SecretService) PostSecret

func (this *SecretService) PostSecret(secret *SecretModel.PostSecretModel, c *gin.Context) *result.ErrorResult

Jump to

Keyboard shortcuts

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