Documentation ¶
Index ¶
- Variables
- type Greeter
- type GreeterRepo
- type GreeterUsecase
- type IPodRepository
- type PodUsecase
- func (pu *PodUsecase) AddPod(pod2 *model.Pod) (int64, error)
- func (pu *PodUsecase) CreatePod(ctx context.Context, pod *model.Pod) (int64, error)
- func (pu *PodUsecase) CreateToK8s(ctx context.Context, podInfo *pb.PodInfo) (err error)
- func (pu *PodUsecase) DeleteFromK8s(ctx context.Context, pod *model.Pod) (err error)
- func (pu *PodUsecase) DeletePod(podID int64) error
- func (pu *PodUsecase) FindAllPod() ([]model.Pod, error)
- func (pu *PodUsecase) FindPodByID(podID int64) (*model.Pod, error)
- func (pu *PodUsecase) SetDeployment(podInfo *pb.PodInfo)
- func (pu *PodUsecase) UpdatePod(pod2 *model.Pod) error
- func (pu *PodUsecase) UpdateToK8s(ctx context.Context, podInfo *pb.PodInfo) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUserNotFound is user not found. ErrUserNotFound = errors.NotFound(v1.ErrorReason_USER_NOT_FOUND.String(), "user not found") )
View Source
var ProviderSet = wire.NewSet(NewGreeterUsecase, NewPodUsecase)
ProviderSet is biz providers.
Functions ¶
This section is empty.
Types ¶
type GreeterRepo ¶
type GreeterRepo interface { Save(context.Context, *Greeter) (*Greeter, error) Update(context.Context, *Greeter) (*Greeter, error) FindByID(context.Context, int64) (*Greeter, error) ListByHello(context.Context, string) ([]*Greeter, error) ListAll(context.Context) ([]*Greeter, error) }
GreeterRepo is a Greater repo.
type GreeterUsecase ¶
type GreeterUsecase struct {
// contains filtered or unexported fields
}
GreeterUsecase is a Greeter usecase.
func NewGreeterUsecase ¶
func NewGreeterUsecase(repo GreeterRepo, logger log.Logger) *GreeterUsecase
NewGreeterUsecase new a Greeter usecase.
func (*GreeterUsecase) CreateGreeter ¶
CreateGreeter creates a Greeter, and returns the new Greeter.
type IPodRepository ¶
type PodUsecase ¶
type PodUsecase struct {
// contains filtered or unexported fields
}
PodUsecase is a Greeter usecase.
func NewPodUsecase ¶
func NewPodUsecase(repo IPodRepository, K8sClientSet *kubernetes.Clientset, logger log.Logger) *PodUsecase
NewPodUsecase 创建 PodRepository
func (*PodUsecase) CreateToK8s ¶
创建pod到k8s中
func (*PodUsecase) DeleteFromK8s ¶
删除pod
func (*PodUsecase) FindPodByID ¶
func (pu *PodUsecase) FindPodByID(podID int64) (*model.Pod, error)
单个查找
func (*PodUsecase) SetDeployment ¶
func (pu *PodUsecase) SetDeployment(podInfo *pb.PodInfo)
func (*PodUsecase) UpdateToK8s ¶
更新deployment,pod
Click to show internal directories.
Click to hide internal directories.