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 *api.Namespace) *api.Response
- func (s *Server) CreateNamespaceIfAbsent(ctx context.Context, req *api.Namespace) error
- func (s *Server) CreateNamespaces(ctx context.Context, req []*api.Namespace) *api.BatchWriteResponse
- func (s *Server) DeleteNamespace(ctx context.Context, req *api.Namespace) *api.Response
- func (s *Server) DeleteNamespaces(ctx context.Context, req []*api.Namespace) *api.BatchWriteResponse
- func (s *Server) GetNamespaceToken(ctx context.Context, req *api.Namespace) *api.Response
- func (s *Server) GetNamespaces(ctx context.Context, query map[string][]string) *api.BatchQueryResponse
- func (s *Server) RecordHistory(entry *model.RecordEntry)
- func (s *Server) SetResourceHooks(hooks ...ResourceHook)
- func (s *Server) UpdateNamespace(ctx context.Context, req *api.Namespace) *api.Response
- func (s *Server) UpdateNamespaceToken(ctx context.Context, req *api.Namespace) *api.Response
- func (s *Server) UpdateNamespaces(ctx context.Context, req []*api.Namespace) *api.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 *api.Namespace) *api.Response // CreateNamespaces Batch creation namespace CreateNamespaces(ctx context.Context, req []*api.Namespace) *api.BatchWriteResponse // DeleteNamespace Delete a single namespace DeleteNamespace(ctx context.Context, req *api.Namespace) *api.Response // DeleteNamespaces Batch delete namespace DeleteNamespaces(ctx context.Context, req []*api.Namespace) *api.BatchWriteResponse // UpdateNamespaces Batch update naming space UpdateNamespaces(ctx context.Context, req []*api.Namespace) *api.BatchWriteResponse // UpdateNamespaceToken Update token with namespace UpdateNamespaceToken(ctx context.Context, req *api.Namespace) *api.Response // GetNamespaces Get a list of namespaces GetNamespaces(ctx context.Context, query map[string][]string) *api.BatchQueryResponse // GetNamespaceToken Get the token with namespace GetNamespaceToken(ctx context.Context, req *api.Namespace) *api.Response // CreateNamespaceIfAbsent Create a single name space CreateNamespaceIfAbsent(ctx context.Context, req *api.Namespace) error }
NamespaceOperateServer Namespace related operation
func TestInitialize ¶
func TestInitialize(_ context.Context, nsOpt *Config, storage store.Store, cacheMgn *cache.CacheManager, authSvr auth.AuthServer) (NamespaceOperateServer, error)
type ResourceEvent ¶
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 ¶
CreateNamespaceIfAbsent 创建命名空间,如果不存在
func (*Server) CreateNamespaces ¶
func (s *Server) CreateNamespaces(ctx context.Context, req []*api.Namespace) *api.BatchWriteResponse
CreateNamespaces 批量创建命名空间
func (*Server) DeleteNamespace ¶
DeleteNamespace 删除单个命名空间
func (*Server) DeleteNamespaces ¶
func (s *Server) DeleteNamespaces(ctx context.Context, req []*api.Namespace) *api.BatchWriteResponse
DeleteNamespaces 批量删除命名空间
func (*Server) GetNamespaceToken ¶
GetNamespaceToken 获取命名空间的token
func (*Server) GetNamespaces ¶
func (s *Server) GetNamespaces(ctx context.Context, query map[string][]string) *api.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 ¶
UpdateNamespaceToken 更新命名空间token
func (*Server) UpdateNamespaces ¶
func (s *Server) UpdateNamespaces(ctx context.Context, req []*api.Namespace) *api.BatchWriteResponse
UpdateNamespaces 批量修改命名空间
Click to show internal directories.
Click to hide internal directories.