Documentation
¶
Index ¶
- type ACLResolver
- type Backend
- type Config
- type MockACLResolver
- type MockBackend
- func (_m *MockBackend) DeleteCAS(ctx context.Context, id *pbresource.ID, version string) error
- func (_m *MockBackend) List(ctx context.Context, consistency storage.ReadConsistency, ...) ([]*pbresource.Resource, error)
- func (_m *MockBackend) ListByOwner(ctx context.Context, id *pbresource.ID) ([]*pbresource.Resource, error)
- func (_m *MockBackend) Read(ctx context.Context, consistency storage.ReadConsistency, id *pbresource.ID) (*pbresource.Resource, error)
- func (_m *MockBackend) WatchList(ctx context.Context, resType storage.UnversionedType, ...) (storage.Watch, error)
- func (_m *MockBackend) WriteCAS(ctx context.Context, res *pbresource.Resource) (*pbresource.Resource, error)
- type MockRegistry
- type Registry
- type Server
- func (s *Server) Delete(ctx context.Context, req *pbresource.DeleteRequest) (*pbresource.DeleteResponse, error)
- func (s *Server) List(ctx context.Context, req *pbresource.ListRequest) (*pbresource.ListResponse, error)
- func (s *Server) ListByOwner(ctx context.Context, req *pbresource.ListByOwnerRequest) (*pbresource.ListByOwnerResponse, error)
- func (s *Server) Read(ctx context.Context, req *pbresource.ReadRequest) (*pbresource.ReadResponse, error)
- func (s *Server) Register(grpcServer *grpc.Server)
- func (s *Server) WatchList(req *pbresource.WatchListRequest, ...) error
- func (s *Server) Write(ctx context.Context, req *pbresource.WriteRequest) (*pbresource.WriteResponse, error)
- func (s *Server) WriteStatus(ctx context.Context, req *pbresource.WriteStatusRequest) (*pbresource.WriteStatusResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACLResolver ¶
type ACLResolver interface {
ResolveTokenAndDefaultMeta(string, *acl.EnterpriseMeta, *acl.AuthorizerContext) (resolver.Result, error)
}
type Config ¶
type Config struct { Logger hclog.Logger Registry Registry // Backend is the storage backend that will be used for resource persistence. Backend Backend ACLResolver ACLResolver }
type MockACLResolver ¶
MockACLResolver is an autogenerated mock type for the ACLResolver type
func NewMockACLResolver ¶
func NewMockACLResolver(t mockConstructorTestingTNewMockACLResolver) *MockACLResolver
NewMockACLResolver creates a new instance of MockACLResolver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockACLResolver) ResolveTokenAndDefaultMeta ¶
func (_m *MockACLResolver) ResolveTokenAndDefaultMeta(_a0 string, _a1 *acl.EnterpriseMeta, _a2 *acl.AuthorizerContext) (resolver.Result, error)
ResolveTokenAndDefaultMeta provides a mock function with given fields: _a0, _a1, _a2
type MockBackend ¶
MockBackend is an autogenerated mock type for the Backend type
func NewMockBackend ¶
func NewMockBackend(t mockConstructorTestingTNewMockBackend) *MockBackend
NewMockBackend creates a new instance of MockBackend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockBackend) DeleteCAS ¶
func (_m *MockBackend) DeleteCAS(ctx context.Context, id *pbresource.ID, version string) error
DeleteCAS provides a mock function with given fields: ctx, id, version
func (*MockBackend) List ¶
func (_m *MockBackend) List(ctx context.Context, consistency storage.ReadConsistency, resType storage.UnversionedType, tenancy *pbresource.Tenancy, namePrefix string) ([]*pbresource.Resource, error)
List provides a mock function with given fields: ctx, consistency, resType, tenancy, namePrefix
func (*MockBackend) ListByOwner ¶
func (_m *MockBackend) ListByOwner(ctx context.Context, id *pbresource.ID) ([]*pbresource.Resource, error)
ListByOwner provides a mock function with given fields: ctx, id
func (*MockBackend) Read ¶
func (_m *MockBackend) Read(ctx context.Context, consistency storage.ReadConsistency, id *pbresource.ID) (*pbresource.Resource, error)
Read provides a mock function with given fields: ctx, consistency, id
func (*MockBackend) WatchList ¶
func (_m *MockBackend) WatchList(ctx context.Context, resType storage.UnversionedType, tenancy *pbresource.Tenancy, namePrefix string) (storage.Watch, error)
WatchList provides a mock function with given fields: ctx, resType, tenancy, namePrefix
func (*MockBackend) WriteCAS ¶
func (_m *MockBackend) WriteCAS(ctx context.Context, res *pbresource.Resource) (*pbresource.Resource, error)
WriteCAS provides a mock function with given fields: ctx, res
type MockRegistry ¶
MockRegistry is an autogenerated mock type for the Registry type
func NewMockRegistry ¶
func NewMockRegistry(t mockConstructorTestingTNewMockRegistry) *MockRegistry
NewMockRegistry creates a new instance of MockRegistry. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockRegistry) Register ¶
func (_m *MockRegistry) Register(reg internalresource.Registration)
Register provides a mock function with given fields: reg
func (*MockRegistry) Resolve ¶
func (_m *MockRegistry) Resolve(typ *pbresource.Type) (internalresource.Registration, bool)
Resolve provides a mock function with given fields: typ
type Server ¶
type Server struct {
Config
}
func (*Server) Delete ¶
func (s *Server) Delete(ctx context.Context, req *pbresource.DeleteRequest) (*pbresource.DeleteResponse, error)
Deletes a resource. - To delete a resource regardless of the stored version, set Version = "" - Supports deleting a resource by name, hence Id.Uid may be empty. - Delete of a previously deleted or non-existent resource is a no-op to support idempotency. - Errors with Aborted if the requested Version does not match the stored Version. - Errors with PermissionDenied if ACL check fails
func (*Server) List ¶
func (s *Server) List(ctx context.Context, req *pbresource.ListRequest) (*pbresource.ListResponse, error)
func (*Server) ListByOwner ¶
func (s *Server) ListByOwner(ctx context.Context, req *pbresource.ListByOwnerRequest) (*pbresource.ListByOwnerResponse, error)
func (*Server) Read ¶
func (s *Server) Read(ctx context.Context, req *pbresource.ReadRequest) (*pbresource.ReadResponse, error)
func (*Server) WatchList ¶
func (s *Server) WatchList(req *pbresource.WatchListRequest, stream pbresource.ResourceService_WatchListServer) error
func (*Server) Write ¶
func (s *Server) Write(ctx context.Context, req *pbresource.WriteRequest) (*pbresource.WriteResponse, error)
func (*Server) WriteStatus ¶
func (s *Server) WriteStatus(ctx context.Context, req *pbresource.WriteStatusRequest) (*pbresource.WriteStatusResponse, error)