Documentation ¶
Index ¶
- func Initialize(ctx context.Context, nsOpt *Config, storage store.Store, ...) error
- type Config
- type NamespaceOperateServer
- type ResourceEvent
- type ResourceHook
- type Server
- func (s *Server) CreateNamespace(ctx context.Context, req *apimodel.Namespace) *apiservice.Response
- func (s *Server) CreateNamespaceIfAbsent(ctx context.Context, req *apimodel.Namespace) (string, *apiservice.Response)
- func (s *Server) CreateNamespaces(ctx context.Context, req []*apimodel.Namespace) *apiservice.BatchWriteResponse
- func (s *Server) DeleteNamespace(ctx context.Context, req *apimodel.Namespace) *apiservice.Response
- func (s *Server) DeleteNamespaces(ctx context.Context, req []*apimodel.Namespace) *apiservice.BatchWriteResponse
- func (s *Server) GetNamespaceToken(ctx context.Context, req *apimodel.Namespace) *apiservice.Response
- func (s *Server) GetNamespaces(ctx context.Context, query map[string][]string) *apiservice.BatchQueryResponse
- func (s *Server) RecordHistory(entry *model.RecordEntry)
- func (s *Server) SetResourceHooks(hooks ...ResourceHook)
- func (s *Server) UpdateNamespace(ctx context.Context, req *apimodel.Namespace) *apiservice.Response
- func (s *Server) UpdateNamespaceToken(ctx context.Context, req *apimodel.Namespace) *apiservice.Response
- func (s *Server) UpdateNamespaces(ctx context.Context, req []*apimodel.Namespace) *apiservice.BatchWriteResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
func Initialize(ctx context.Context, nsOpt *Config, storage store.Store, cacheMgn *cache.CacheManager) error
Initialize 初始化
Types ¶
type NamespaceOperateServer ¶
type NamespaceOperateServer interface { // CreateNamespace Create a single name space CreateNamespace(ctx context.Context, req *apimodel.Namespace) *apiservice.Response // CreateNamespaces Batch creation namespace CreateNamespaces(ctx context.Context, req []*apimodel.Namespace) *apiservice.BatchWriteResponse // DeleteNamespace Delete a single namespace DeleteNamespace(ctx context.Context, req *apimodel.Namespace) *apiservice.Response // DeleteNamespaces Batch delete namespace DeleteNamespaces(ctx context.Context, req []*apimodel.Namespace) *apiservice.BatchWriteResponse // UpdateNamespaces Batch update naming space UpdateNamespaces(ctx context.Context, req []*apimodel.Namespace) *apiservice.BatchWriteResponse // UpdateNamespaceToken Update token with namespace UpdateNamespaceToken(ctx context.Context, req *apimodel.Namespace) *apiservice.Response // GetNamespaces Get a list of namespaces GetNamespaces(ctx context.Context, query map[string][]string) *apiservice.BatchQueryResponse // GetNamespaceToken Get the token with namespace GetNamespaceToken(ctx context.Context, req *apimodel.Namespace) *apiservice.Response // CreateNamespaceIfAbsent Create a single name space CreateNamespaceIfAbsent(ctx context.Context, req *apimodel.Namespace) (string, *apiservice.Response) }
NamespaceOperateServer Namespace related operation
func TestInitialize ¶
func TestInitialize(_ context.Context, nsOpt *Config, storage store.Store, cacheMgn *cache.CacheManager, userMgn auth.UserServer, strategyMgn auth.StrategyServer) (NamespaceOperateServer, error)
type ResourceEvent ¶
type ResourceEvent struct { ReqNamespace *apimodel.Namespace Namespace *model.Namespace IsRemove bool }
ResourceEvent 资源事件
type ResourceHook ¶
type ResourceHook interface { // Before // @param ctx // @param resourceType Before(ctx context.Context, resourceType model.Resource) // After // @param ctx // @param resourceType // @param res After(ctx context.Context, resourceType model.Resource, res *ResourceEvent) error }
ResourceHook The listener is placed before and after the resource operation, only normal flow
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) CreateNamespace ¶
CreateNamespace 创建单个命名空间
func (*Server) CreateNamespaceIfAbsent ¶
func (s *Server) CreateNamespaceIfAbsent(ctx context.Context, req *apimodel.Namespace) (string, *apiservice.Response)
CreateNamespaceIfAbsent 创建命名空间,如果不存在
func (*Server) CreateNamespaces ¶
func (s *Server) CreateNamespaces(ctx context.Context, req []*apimodel.Namespace) *apiservice.BatchWriteResponse
CreateNamespaces 批量创建命名空间
func (*Server) DeleteNamespace ¶
DeleteNamespace 删除单个命名空间
func (*Server) DeleteNamespaces ¶
func (s *Server) DeleteNamespaces(ctx context.Context, req []*apimodel.Namespace) *apiservice.BatchWriteResponse
DeleteNamespaces 批量删除命名空间
func (*Server) GetNamespaceToken ¶
func (s *Server) GetNamespaceToken(ctx context.Context, req *apimodel.Namespace) *apiservice.Response
GetNamespaceToken 获取命名空间的token
func (*Server) GetNamespaces ¶
func (s *Server) GetNamespaces(ctx context.Context, query map[string][]string) *apiservice.BatchQueryResponse
GetNamespaces 查询命名空间
func (*Server) RecordHistory ¶
func (s *Server) RecordHistory(entry *model.RecordEntry)
RecordHistory server对外提供history插件的简单封装
func (*Server) SetResourceHooks ¶
func (s *Server) SetResourceHooks(hooks ...ResourceHook)
SetResourceHooks 返回Cache
func (*Server) UpdateNamespace ¶
UpdateNamespace 修改单个命名空间
func (*Server) UpdateNamespaceToken ¶
func (s *Server) UpdateNamespaceToken(ctx context.Context, req *apimodel.Namespace) *apiservice.Response
UpdateNamespaceToken 更新命名空间token
func (*Server) UpdateNamespaces ¶
func (s *Server) UpdateNamespaces(ctx context.Context, req []*apimodel.Namespace) *apiservice.BatchWriteResponse
UpdateNamespaces 批量修改命名空间
Click to show internal directories.
Click to hide internal directories.