Documentation
¶
Index ¶
- func NewMockService(trust trustmappingv1.ServiceClient) sessionmanager.Service
- type FakeSessionManagerClient
- func (f *FakeSessionManagerClient) ApplyTrustMapping(ctx context.Context, req *trustmappingv1.ApplyTrustMappingRequest, ...) (*trustmappingv1.ApplyTrustMappingResponse, error)
- func (f *FakeSessionManagerClient) BlockTrustMapping(ctx context.Context, req *trustmappingv1.BlockTrustMappingRequest, ...) (*trustmappingv1.BlockTrustMappingResponse, error)
- func (f *FakeSessionManagerClient) RemoveTrustMapping(ctx context.Context, req *trustmappingv1.RemoveTrustMappingRequest, ...) (*trustmappingv1.RemoveTrustMappingResponse, error)
- func (f *FakeSessionManagerClient) UnblockTrustMapping(ctx context.Context, req *trustmappingv1.UnblockTrustMappingRequest, ...) (*trustmappingv1.UnblockTrustMappingResponse, error)
- type FakeSessionManagerService
- func (f *FakeSessionManagerService) ApplyTrustMapping(_ context.Context, _ *trustmappingv1.ApplyTrustMappingRequest) (*trustmappingv1.ApplyTrustMappingResponse, error)
- func (f *FakeSessionManagerService) BlockTrustMapping(ctx context.Context, req *trustmappingv1.BlockTrustMappingRequest) (*trustmappingv1.BlockTrustMappingResponse, error)
- func (f *FakeSessionManagerService) RemoveTrustMapping(_ context.Context, _ *trustmappingv1.RemoveTrustMappingRequest) (*trustmappingv1.RemoveTrustMappingResponse, error)
- func (f *FakeSessionManagerService) UnblockTrustMapping(ctx context.Context, req *trustmappingv1.UnblockTrustMappingRequest) (*trustmappingv1.UnblockTrustMappingResponse, error)
- type MockServiceStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockService ¶
func NewMockService(trust trustmappingv1.ServiceClient) sessionmanager.Service
Types ¶
type FakeSessionManagerClient ¶
type FakeSessionManagerClient struct {
MockApplyTrustMapping func(
ctx context.Context,
req *trustmappingv1.ApplyTrustMappingRequest,
) (*trustmappingv1.ApplyTrustMappingResponse, error)
MockBlockTrustMapping func(
ctx context.Context,
req *trustmappingv1.BlockTrustMappingRequest,
) (*trustmappingv1.BlockTrustMappingResponse, error)
MockUnblockTrustMapping func(
ctx context.Context,
req *trustmappingv1.UnblockTrustMappingRequest,
) (*trustmappingv1.UnblockTrustMappingResponse, error)
MockRemoveTrustMapping func(
ctx context.Context,
req *trustmappingv1.RemoveTrustMappingRequest,
) (*trustmappingv1.RemoveTrustMappingResponse, error)
}
FakeSessionManagerClient is a fake implementation of trustmappingv1.ServiceClient that can be used for testing purposes. sonarignore
func NewFakeSessionManagerClient ¶
func NewFakeSessionManagerClient() *FakeSessionManagerClient
NewFakeSessionManagerClient creates a new fake session manager client
func (*FakeSessionManagerClient) ApplyTrustMapping ¶ added in v0.12.0
func (f *FakeSessionManagerClient) ApplyTrustMapping( ctx context.Context, req *trustmappingv1.ApplyTrustMappingRequest, _ ...grpc.CallOption, ) (*trustmappingv1.ApplyTrustMappingResponse, error)
ApplyTrustMapping implements the trustmappingv1.ServiceClient interface
func (*FakeSessionManagerClient) BlockTrustMapping ¶ added in v0.12.0
func (f *FakeSessionManagerClient) BlockTrustMapping( ctx context.Context, req *trustmappingv1.BlockTrustMappingRequest, _ ...grpc.CallOption, ) (*trustmappingv1.BlockTrustMappingResponse, error)
func (*FakeSessionManagerClient) RemoveTrustMapping ¶ added in v0.12.0
func (f *FakeSessionManagerClient) RemoveTrustMapping( ctx context.Context, req *trustmappingv1.RemoveTrustMappingRequest, _ ...grpc.CallOption, ) (*trustmappingv1.RemoveTrustMappingResponse, error)
RemoveTrustMapping implements the trustmappingv1.ServiceClient interface
func (*FakeSessionManagerClient) UnblockTrustMapping ¶ added in v0.12.0
func (f *FakeSessionManagerClient) UnblockTrustMapping( ctx context.Context, req *trustmappingv1.UnblockTrustMappingRequest, _ ...grpc.CallOption, ) (*trustmappingv1.UnblockTrustMappingResponse, error)
type FakeSessionManagerService ¶
type FakeSessionManagerService struct {
trustmappingv1.UnimplementedServiceServer
// Configurable behavior for ApplyTrustMapping
ApplyTrustMappingError error
ApplyTrustMappingSuccess bool
ApplyTrustMappingMessage string
// Configurable behavior for BlockTrustMapping
MockBlockTrustMapping func(
ctx context.Context,
req *trustmappingv1.BlockTrustMappingRequest,
) (*trustmappingv1.BlockTrustMappingResponse, error)
// Configurable behavior for UnblockTrustMapping
MockUnblockTrustMapping func(
ctx context.Context,
req *trustmappingv1.UnblockTrustMappingRequest,
) (*trustmappingv1.UnblockTrustMappingResponse, error)
// Configurable behavior for RemoveTrustMapping
RemoveTrustMappingError error
RemoveTrustMappingSuccess bool
RemoveTrustMappingMessage string
}
FakeSessionManagerService is a fake implementation of TrustMapping ServiceServer that can be used for testing purposes, particularly for integration tests that need a gRPC server. sonarignore
func NewFakeSessionManagerService ¶
func NewFakeSessionManagerService() *FakeSessionManagerService
NewFakeSessionManagerService creates a new fake session manager service with default success behavior
func (*FakeSessionManagerService) ApplyTrustMapping ¶ added in v0.12.0
func (f *FakeSessionManagerService) ApplyTrustMapping( _ context.Context, _ *trustmappingv1.ApplyTrustMappingRequest, ) (*trustmappingv1.ApplyTrustMappingResponse, error)
ApplyTrustMapping implements the trustmappingv1.ServiceServer interface
func (*FakeSessionManagerService) BlockTrustMapping ¶ added in v0.12.0
func (f *FakeSessionManagerService) BlockTrustMapping( ctx context.Context, req *trustmappingv1.BlockTrustMappingRequest, ) (*trustmappingv1.BlockTrustMappingResponse, error)
BlockTrustMapping implements the trustmappingv1.ServiceServer interface
func (*FakeSessionManagerService) RemoveTrustMapping ¶ added in v0.12.0
func (f *FakeSessionManagerService) RemoveTrustMapping( _ context.Context, _ *trustmappingv1.RemoveTrustMappingRequest, ) (*trustmappingv1.RemoveTrustMappingResponse, error)
RemoveTrustMapping implements the trustmappingv1.ServiceServer interface
func (*FakeSessionManagerService) UnblockTrustMapping ¶ added in v0.12.0
func (f *FakeSessionManagerService) UnblockTrustMapping( ctx context.Context, req *trustmappingv1.UnblockTrustMappingRequest, ) (*trustmappingv1.UnblockTrustMappingResponse, error)
UnblockTrustMapping implements the trustmappingv1.ServiceServer interface
type MockServiceStruct ¶
type MockServiceStruct struct {
Client trustmappingv1.ServiceClient
}
MockServiceStruct is a mock implementation that can be used for testing purposes.
func (*MockServiceStruct) Close ¶
func (c *MockServiceStruct) Close() error
func (*MockServiceStruct) TrustMapping ¶ added in v0.12.0
func (c *MockServiceStruct) TrustMapping() trustmappingv1.ServiceClient