Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PoliciesSrv ¶
type PoliciesSrv interface { Create(ctx context.Context, policy *v1.Policy, opts metav1.CreateOptions) error Update(ctx context.Context, policy *v1.Policy, opts metav1.UpdateOptions) error Delete(ctx context.Context, username string, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, username string, names []string, opts metav1.DeleteOptions) error Get(ctx context.Context, username string, name string, opts metav1.GetOptions) (*v1.Policy, error) List(ctx context.Context, username string, opts metav1.ListOptions) (*v1.PolicyList, error) }
type SecretSrv ¶
type SecretSrv interface { Create(ctx context.Context, secret *v1.Secret, opts metav1.CreateOptions) error Update(ctx context.Context, secret *v1.Secret, opts metav1.UpdateOptions) error Delete(ctx context.Context, username, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, username string, secretIDs []string, opts metav1.DeleteOptions) error Get(ctx context.Context, username, name string, opts metav1.GetOptions) (*v1.Secret, error) List(ctx context.Context, username string, opts metav1.ListOptions) (*v1.SecretList, error) }
type Service ¶
type Service interface { Users() UserService Policies() PoliciesSrv Secrets() SecretSrv }
使用 db 接口
func NewService ¶
NewService returns Service interface.
type UserService ¶
type UserService interface { Create(ctx context.Context, user *v1.User, opts metav1.CreateOptions) error Update(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) error Delete(ctx context.Context, username string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, usernames []string, opts metav1.DeleteOptions) error Get(ctx context.Context, username string, opts metav1.GetOptions) (*v1.User, error) List(ctx context.Context, opts metav1.ListOptions) (*v1.UserList, error) ListWithBadPerformance(ctx context.Context, opts metav1.ListOptions) (*v1.UserList, error) ChangePassword(ctx context.Context, user *v1.User) error //新添加的功能 }
实现 service 的方法
Click to show internal directories.
Click to hide internal directories.