Documentation
¶
Index ¶
- func ClearGrpcDisruptions(client pb.DisruptionListenerClient) error
- func GenerateEndpointSpecs(endpoints []chaosv1beta1.EndpointAlteration) []*pb.EndpointSpec
- func SendGrpcDisruption(client pb.DisruptionListenerClient, spec chaosv1beta1.GRPCDisruptionSpec) error
- type ChaosDisruptionListener
- func (d *ChaosDisruptionListener) ChaosServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (response interface{}, err error)
- func (d *ChaosDisruptionListener) Disrupt(ctx context.Context, ds *pb.DisruptionSpec) (*emptypb.Empty, error)
- func (d *ChaosDisruptionListener) ResetDisruptions(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearGrpcDisruptions ¶
func ClearGrpcDisruptions(client pb.DisruptionListenerClient) error
ClearGrpcDisruptions executes a ResetDisruptions call on the provided DisruptionListenerClient
func GenerateEndpointSpecs ¶
func GenerateEndpointSpecs(endpoints []chaosv1beta1.EndpointAlteration) []*pb.EndpointSpec
GenerateEndpointSpecs converts a slice of EndpointAlterations into a slice of EndpointSpecs which can be sent through gRPC call to disruptionListener
func SendGrpcDisruption ¶
func SendGrpcDisruption(client pb.DisruptionListenerClient, spec chaosv1beta1.GRPCDisruptionSpec) error
SendGrpcDisruption takes in a CRD specification for GRPC disruptions and executes a Disrupt call on the provided DisruptionListenerClient
Types ¶
type ChaosDisruptionListener ¶
type ChaosDisruptionListener struct { pb.UnimplementedDisruptionListenerServer // contains filtered or unexported fields }
ChaosDisruptionListener is a gRPC Service that can disrupt endpoints of a gRPC server. The interface it is implementing was generated in the grpc/disruptionlistener package.
func NewDisruptionListener ¶
func NewDisruptionListener(logger *zap.SugaredLogger) *ChaosDisruptionListener
NewDisruptionListener creates a new DisruptionListener Service with the logger instantiated and DisruptionConfiguration set to be empty
func (*ChaosDisruptionListener) ChaosServerInterceptor ¶
func (d *ChaosDisruptionListener) ChaosServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (response interface{}, err error)
ChaosServerInterceptor is a function which can be registered on instantiation of a gRPC server to intercept all traffic to the server and crosscheck their endpoints to disrupt them.
func (*ChaosDisruptionListener) Disrupt ¶
func (d *ChaosDisruptionListener) Disrupt(ctx context.Context, ds *pb.DisruptionSpec) (*emptypb.Empty, error)
Disrupt receives a disruption specification and configures the interceptor to spoof responses to specified endpoints.
func (*ChaosDisruptionListener) ResetDisruptions ¶
func (d *ChaosDisruptionListener) ResetDisruptions(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
ResetDisruptions removes all configured endpoint alterations for DisruptionListener.
Directories
¶
Path | Synopsis |
---|---|
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. |