Documentation ¶
Index ¶
- type IUserDataService
- type UserDataService
- func (u *UserDataService) AddUser(user *model.User) (int64, error)
- func (u *UserDataService) DeleteUser(userID int64) error
- func (u *UserDataService) FindAllUser() ([]model.User, error)
- func (u *UserDataService) FindUserByID(userID int64) (*model.User, error)
- func (u *UserDataService) UpdateUser(user *model.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IUserDataService ¶
type IUserDataService interface { AddUser(*model.User) (int64, error) DeleteUser(int64) error UpdateUser(*model.User) error FindUserByID(int64) (*model.User, error) FindAllUser() ([]model.User, error) }
这里是接口类型
func NewUserDataService ¶
func NewUserDataService(userRepository repository.IUserRepository, clientSet *kubernetes.Clientset) IUserDataService
创建 注意:返回值 IUserDataService 接口类型
type UserDataService ¶
type UserDataService struct { //注意:这里是 IUserRepository 类型 UserRepository repository.IUserRepository K8sClientSet *kubernetes.Clientset // contains filtered or unexported fields }
func (*UserDataService) AddUser ¶
func (u *UserDataService) AddUser(user *model.User) (int64, error)
插入
func (*UserDataService) FindAllUser ¶
func (u *UserDataService) FindAllUser() ([]model.User, error)
查找
func (*UserDataService) FindUserByID ¶
func (u *UserDataService) FindUserByID(userID int64) (*model.User, error)
查找
func (*UserDataService) UpdateUser ¶
func (u *UserDataService) UpdateUser(user *model.User) error
更新
Click to show internal directories.
Click to hide internal directories.