resource

package
v1.16.109 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2023 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

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 Backend

type Backend interface {
	storage.Backend
}

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

type MockACLResolver struct {
	mock.Mock
}

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

type MockBackend struct {
	mock.Mock
}

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

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

type MockRegistry struct {
	mock.Mock
}

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

Resolve provides a mock function with given fields: typ

type Registry

type Registry interface {
	resource.Registry
}

type Server

type Server struct {
	Config
}

func NewServer

func NewServer(cfg Config) *Server

func (*Server) Delete

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 (*Server) Read

func (*Server) Register

func (s *Server) Register(grpcServer *grpc.Server)

func (*Server) Write

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL