Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type BumpTime
- type Client
- type ConfigRequest
- func (*ConfigRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ConfigRequest) GetConfigFile() []byte
- func (x *ConfigRequest) GetServiceType() ServiceType
- func (*ConfigRequest) ProtoMessage()
- func (x *ConfigRequest) ProtoReflect() protoreflect.Message
- func (x *ConfigRequest) Reset()
- func (x *ConfigRequest) String() string
- func (x *ConfigRequest) Validate() error
- type Kill
- type Logs
- type Nemesis
- type NemesisRequest
- func (*NemesisRequest) Descriptor() ([]byte, []int)deprecated
- func (x *NemesisRequest) GetBumpTime() *BumpTime
- func (x *NemesisRequest) GetDuration() *durationpb.Duration
- func (x *NemesisRequest) GetKill() *Kill
- func (x *NemesisRequest) GetPause() *Pause
- func (m *NemesisRequest) GetPayload() isNemesisRequest_Payload
- func (x *NemesisRequest) GetRestart() *Restart
- func (x *NemesisRequest) GetStrobeTime() *StrobeTime
- func (x *NemesisRequest) Name() string
- func (x *NemesisRequest) Nemesis() Nemesis
- func (*NemesisRequest) ProtoMessage()
- func (x *NemesisRequest) ProtoReflect() protoreflect.Message
- func (x *NemesisRequest) Reset()
- func (x *NemesisRequest) String() string
- func (x *NemesisRequest) Validate() error
- type NemesisRequest_BumpTime
- type NemesisRequest_Kill
- type NemesisRequest_Pause
- type NemesisRequest_Restart
- type NemesisRequest_StrobeTime
- type Pause
- type ResetRequest
- func (*ResetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ResetRequest) GetNemesis() bool
- func (x *ResetRequest) GetService() bool
- func (x *ResetRequest) GetTime() *timestamppb.Timestamp
- func (x *ResetRequest) GetTruncateLogs() bool
- func (*ResetRequest) ProtoMessage()
- func (x *ResetRequest) ProtoReflect() protoreflect.Message
- func (x *ResetRequest) Reset()
- func (x *ResetRequest) String() string
- func (x *ResetRequest) Validate() error
- type Restart
- type Server
- type ServiceClient
- type ServiceServer
- type ServiceType
- func (ServiceType) Descriptor() protoreflect.EnumDescriptor
- func (x ServiceType) Enum() *ServiceType
- func (ServiceType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ServiceType) IsValid() bool
- func (x ServiceType) Number() protoreflect.EnumNumber
- func (x ServiceType) String() string
- func (ServiceType) Type() protoreflect.EnumType
- type Status
- func (*Status) Descriptor() ([]byte, []int)deprecated
- func (x *Status) GetNemesisCount() uint32
- func (x *Status) GetServiceActive() bool
- func (x *Status) GetServiceType() ServiceType
- func (x *Status) GetTime() *timestamppb.Timestamp
- func (*Status) ProtoMessage()
- func (x *Status) ProtoReflect() protoreflect.Message
- func (x *Status) Reset()
- func (x *Status) String() string
- type StrobeTime
- func (*StrobeTime) Descriptor() ([]byte, []int)deprecated
- func (x *StrobeTime) GetDelta() int32
- func (x *StrobeTime) GetPeriod() uint32
- func (*StrobeTime) ProtoMessage()
- func (x *StrobeTime) ProtoReflect() protoreflect.Message
- func (x *StrobeTime) Reset()
- func (n *StrobeTime) Run(ctx context.Context) error
- func (x *StrobeTime) String() string
- type UnimplementedServiceServer
- func (UnimplementedServiceServer) ConfigService(context.Context, *ConfigRequest) (*emptypb.Empty, error)
- func (UnimplementedServiceServer) GetLogs(context.Context, *emptypb.Empty) (*Logs, error)
- func (UnimplementedServiceServer) GetStatus(context.Context, *emptypb.Empty) (*Status, error)
- func (UnimplementedServiceServer) ResetService(context.Context, *ResetRequest) (*emptypb.Empty, error)
- func (UnimplementedServiceServer) RestartService(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
- func (UnimplementedServiceServer) RunNemesis(context.Context, *NemesisRequest) (*emptypb.Empty, error)
- func (UnimplementedServiceServer) StartService(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
- func (UnimplementedServiceServer) StopService(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
- type UnsafeServiceServer
Constants ¶
const ( Port = 9909 StorageDir = "/storage" DataDir = StorageDir + "/data" ConfigFile = StorageDir + "/config.yaml" LogFile = StorageDir + "/scout.log" ServiceTypeFile = StorageDir + "/service_type" UID = 888 GID = 888 )
const ( Service_GetStatus_FullMethodName = "/agent.Service/GetStatus" Service_ConfigService_FullMethodName = "/agent.Service/ConfigService" Service_StartService_FullMethodName = "/agent.Service/StartService" Service_StopService_FullMethodName = "/agent.Service/StopService" Service_RestartService_FullMethodName = "/agent.Service/RestartService" Service_ResetService_FullMethodName = "/agent.Service/ResetService" Service_GetLogs_FullMethodName = "/agent.Service/GetLogs" Service_RunNemesis_FullMethodName = "/agent.Service/RunNemesis" )
Variables ¶
var ( ServiceType_name = map[int32]string{ 0: "None", 1: "Control", 2: "Data", 3: "Api", 4: "Unknown", } ServiceType_value = map[string]int32{ "None": 0, "Control": 1, "Data": 2, "Api": 3, "Unknown": 4, } )
Enum value maps for ServiceType.
var File_internal_testing_agent_agent_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "agent.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetStatus", Handler: _Service_GetStatus_Handler, }, { MethodName: "ConfigService", Handler: _Service_ConfigService_Handler, }, { MethodName: "StartService", Handler: _Service_StartService_Handler, }, { MethodName: "StopService", Handler: _Service_StopService_Handler, }, { MethodName: "RestartService", Handler: _Service_RestartService_Handler, }, { MethodName: "ResetService", Handler: _Service_ResetService_Handler, }, { MethodName: "GetLogs", Handler: _Service_GetLogs_Handler, }, { MethodName: "RunNemesis", Handler: _Service_RunNemesis_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "internal/testing/agent/agent.proto", }
Service_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterServiceServer ¶
func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
Types ¶
type BumpTime ¶
type BumpTime struct {
Delta int32 `protobuf:"varint,1,opt,name=delta,proto3" json:"delta,omitempty"`
// contains filtered or unexported fields
}
Changes the current system time by the provided delta and then restores it to the original value. Delta is expected in millis.
func (*BumpTime) Descriptor
deprecated
func (*BumpTime) ProtoMessage ¶
func (*BumpTime) ProtoMessage()
func (*BumpTime) ProtoReflect ¶
func (x *BumpTime) ProtoReflect() protoreflect.Message
type Client ¶
type Client struct {
ServiceClient
// contains filtered or unexported fields
}
type ConfigRequest ¶
type ConfigRequest struct {
ServiceType ServiceType `protobuf:"varint,1,opt,name=service_type,json=serviceType,proto3,enum=agent.ServiceType" json:"service_type,omitempty"`
ConfigFile []byte `protobuf:"bytes,2,opt,name=config_file,json=configFile,proto3" json:"config_file,omitempty"`
// contains filtered or unexported fields
}
func (*ConfigRequest) Descriptor
deprecated
func (*ConfigRequest) Descriptor() ([]byte, []int)
Deprecated: Use ConfigRequest.ProtoReflect.Descriptor instead.
func (*ConfigRequest) GetConfigFile ¶
func (x *ConfigRequest) GetConfigFile() []byte
func (*ConfigRequest) GetServiceType ¶
func (x *ConfigRequest) GetServiceType() ServiceType
func (*ConfigRequest) ProtoMessage ¶
func (*ConfigRequest) ProtoMessage()
func (*ConfigRequest) ProtoReflect ¶
func (x *ConfigRequest) ProtoReflect() protoreflect.Message
func (*ConfigRequest) Reset ¶
func (x *ConfigRequest) Reset()
func (*ConfigRequest) String ¶
func (x *ConfigRequest) String() string
func (*ConfigRequest) Validate ¶
func (x *ConfigRequest) Validate() error
type Kill ¶
type Kill struct {
// contains filtered or unexported fields
}
Kills the service using SIGKILL signal and systemd will auto restart it. Can be used to simulate hard crash-restart fault.
func (*Kill) Descriptor
deprecated
func (*Kill) ProtoMessage ¶
func (*Kill) ProtoMessage()
func (*Kill) ProtoReflect ¶
func (x *Kill) ProtoReflect() protoreflect.Message
type Logs ¶
type Logs struct {
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
// contains filtered or unexported fields
}
func (*Logs) Descriptor
deprecated
func (*Logs) ProtoMessage ¶
func (*Logs) ProtoMessage()
func (*Logs) ProtoReflect ¶
func (x *Logs) ProtoReflect() protoreflect.Message
type NemesisRequest ¶
type NemesisRequest struct {
Duration *durationpb.Duration `protobuf:"bytes,1,opt,name=duration,proto3" json:"duration,omitempty"`
// Types that are assignable to Payload:
//
// *NemesisRequest_Kill
// *NemesisRequest_Pause
// *NemesisRequest_Restart
// *NemesisRequest_BumpTime
// *NemesisRequest_StrobeTime
Payload isNemesisRequest_Payload `protobuf_oneof:"payload"`
// contains filtered or unexported fields
}
func NewNemesisRequest ¶
func NewNemesisRequest(nemesis Nemesis, duration time.Duration) *NemesisRequest
func (*NemesisRequest) Descriptor
deprecated
func (*NemesisRequest) Descriptor() ([]byte, []int)
Deprecated: Use NemesisRequest.ProtoReflect.Descriptor instead.
func (*NemesisRequest) GetBumpTime ¶
func (x *NemesisRequest) GetBumpTime() *BumpTime
func (*NemesisRequest) GetDuration ¶
func (x *NemesisRequest) GetDuration() *durationpb.Duration
func (*NemesisRequest) GetKill ¶
func (x *NemesisRequest) GetKill() *Kill
func (*NemesisRequest) GetPause ¶
func (x *NemesisRequest) GetPause() *Pause
func (*NemesisRequest) GetPayload ¶
func (m *NemesisRequest) GetPayload() isNemesisRequest_Payload
func (*NemesisRequest) GetRestart ¶
func (x *NemesisRequest) GetRestart() *Restart
func (*NemesisRequest) GetStrobeTime ¶
func (x *NemesisRequest) GetStrobeTime() *StrobeTime
func (*NemesisRequest) Name ¶
func (x *NemesisRequest) Name() string
func (*NemesisRequest) Nemesis ¶
func (x *NemesisRequest) Nemesis() Nemesis
func (*NemesisRequest) ProtoMessage ¶
func (*NemesisRequest) ProtoMessage()
func (*NemesisRequest) ProtoReflect ¶
func (x *NemesisRequest) ProtoReflect() protoreflect.Message
func (*NemesisRequest) Reset ¶
func (x *NemesisRequest) Reset()
func (*NemesisRequest) String ¶
func (x *NemesisRequest) String() string
func (*NemesisRequest) Validate ¶
func (x *NemesisRequest) Validate() error
type NemesisRequest_BumpTime ¶
type NemesisRequest_BumpTime struct {
BumpTime *BumpTime `protobuf:"bytes,5,opt,name=bump_time,json=bumpTime,proto3,oneof"`
}
type NemesisRequest_Kill ¶
type NemesisRequest_Kill struct {
Kill *Kill `protobuf:"bytes,2,opt,name=kill,proto3,oneof"`
}
type NemesisRequest_Pause ¶
type NemesisRequest_Pause struct {
Pause *Pause `protobuf:"bytes,3,opt,name=pause,proto3,oneof"`
}
type NemesisRequest_Restart ¶
type NemesisRequest_Restart struct {
Restart *Restart `protobuf:"bytes,4,opt,name=restart,proto3,oneof"`
}
type NemesisRequest_StrobeTime ¶
type NemesisRequest_StrobeTime struct {
StrobeTime *StrobeTime `protobuf:"bytes,6,opt,name=strobe_time,json=strobeTime,proto3,oneof"`
}
type Pause ¶
type Pause struct {
// contains filtered or unexported fields
}
Pauses the service and then resumes it. Can be used to simulate a GC pause.
func (*Pause) Descriptor
deprecated
func (*Pause) ProtoMessage ¶
func (*Pause) ProtoMessage()
func (*Pause) ProtoReflect ¶
func (x *Pause) ProtoReflect() protoreflect.Message
type ResetRequest ¶
type ResetRequest struct {
Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"`
Service bool `protobuf:"varint,2,opt,name=service,proto3" json:"service,omitempty"`
Nemesis bool `protobuf:"varint,3,opt,name=nemesis,proto3" json:"nemesis,omitempty"`
TruncateLogs bool `protobuf:"varint,4,opt,name=truncate_logs,json=truncateLogs,proto3" json:"truncate_logs,omitempty"`
// contains filtered or unexported fields
}
func (*ResetRequest) Descriptor
deprecated
func (*ResetRequest) Descriptor() ([]byte, []int)
Deprecated: Use ResetRequest.ProtoReflect.Descriptor instead.
func (*ResetRequest) GetNemesis ¶
func (x *ResetRequest) GetNemesis() bool
func (*ResetRequest) GetService ¶
func (x *ResetRequest) GetService() bool
func (*ResetRequest) GetTime ¶
func (x *ResetRequest) GetTime() *timestamppb.Timestamp
func (*ResetRequest) GetTruncateLogs ¶
func (x *ResetRequest) GetTruncateLogs() bool
func (*ResetRequest) ProtoMessage ¶
func (*ResetRequest) ProtoMessage()
func (*ResetRequest) ProtoReflect ¶
func (x *ResetRequest) ProtoReflect() protoreflect.Message
func (*ResetRequest) Reset ¶
func (x *ResetRequest) Reset()
func (*ResetRequest) String ¶
func (x *ResetRequest) String() string
func (*ResetRequest) Validate ¶
func (x *ResetRequest) Validate() error
type Restart ¶
type Restart struct {
// contains filtered or unexported fields
}
Stops the service until ctx in done and then starts it back again. Can be used to simulate soft restart as in normal maintenance ops.
func (*Restart) Descriptor
deprecated
func (*Restart) ProtoMessage ¶
func (*Restart) ProtoMessage()
func (*Restart) ProtoReflect ¶
func (x *Restart) ProtoReflect() protoreflect.Message
type ServiceClient ¶
type ServiceClient interface {
GetStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Status, error)
ConfigService(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
StartService(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
StopService(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
RestartService(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
ResetService(ctx context.Context, in *ResetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
GetLogs(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Logs, error)
RunNemesis(ctx context.Context, in *NemesisRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
ServiceClient is the client API for Service service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
Service represents the agent service.
func NewServiceClient ¶
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceServer ¶
type ServiceServer interface {
GetStatus(context.Context, *emptypb.Empty) (*Status, error)
ConfigService(context.Context, *ConfigRequest) (*emptypb.Empty, error)
StartService(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
StopService(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
RestartService(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
ResetService(context.Context, *ResetRequest) (*emptypb.Empty, error)
GetLogs(context.Context, *emptypb.Empty) (*Logs, error)
RunNemesis(context.Context, *NemesisRequest) (*emptypb.Empty, error)
// contains filtered or unexported methods
}
ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility.
Service represents the agent service.
type ServiceType ¶
type ServiceType int32
const ( ServiceType_None ServiceType = 0 ServiceType_Control ServiceType = 1 ServiceType_Data ServiceType = 2 ServiceType_Api ServiceType = 3 ServiceType_Unknown ServiceType = 4 )
func (ServiceType) Descriptor ¶
func (ServiceType) Descriptor() protoreflect.EnumDescriptor
func (ServiceType) Enum ¶
func (x ServiceType) Enum() *ServiceType
func (ServiceType) EnumDescriptor
deprecated
func (ServiceType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ServiceType.Descriptor instead.
func (ServiceType) IsValid ¶
func (x ServiceType) IsValid() bool
func (ServiceType) Number ¶
func (x ServiceType) Number() protoreflect.EnumNumber
func (ServiceType) String ¶
func (x ServiceType) String() string
func (ServiceType) Type ¶
func (ServiceType) Type() protoreflect.EnumType
type Status ¶
type Status struct {
ServiceType ServiceType `protobuf:"varint,1,opt,name=service_type,json=serviceType,proto3,enum=agent.ServiceType" json:"service_type,omitempty"`
ServiceActive bool `protobuf:"varint,2,opt,name=service_active,json=serviceActive,proto3" json:"service_active,omitempty"`
Time *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=time,proto3" json:"time,omitempty"`
NemesisCount uint32 `protobuf:"varint,4,opt,name=nemesis_count,json=nemesisCount,proto3" json:"nemesis_count,omitempty"`
// contains filtered or unexported fields
}
func (*Status) Descriptor
deprecated
func (*Status) GetNemesisCount ¶
func (*Status) GetServiceActive ¶
func (*Status) GetServiceType ¶
func (x *Status) GetServiceType() ServiceType
func (*Status) GetTime ¶
func (x *Status) GetTime() *timestamppb.Timestamp
func (*Status) ProtoMessage ¶
func (*Status) ProtoMessage()
func (*Status) ProtoReflect ¶
func (x *Status) ProtoReflect() protoreflect.Message
type StrobeTime ¶
type StrobeTime struct {
Delta int32 `protobuf:"varint,1,opt,name=delta,proto3" json:"delta,omitempty"`
Period uint32 `protobuf:"varint,2,opt,name=period,proto3" json:"period,omitempty"`
// contains filtered or unexported fields
}
StrobeTime changes the current system time back and forth by adding then removing the provided delta, repeatedly, in each period. Delta and period are expected in millis.
func (*StrobeTime) Descriptor
deprecated
func (*StrobeTime) Descriptor() ([]byte, []int)
Deprecated: Use StrobeTime.ProtoReflect.Descriptor instead.
func (*StrobeTime) GetDelta ¶
func (x *StrobeTime) GetDelta() int32
func (*StrobeTime) GetPeriod ¶
func (x *StrobeTime) GetPeriod() uint32
func (*StrobeTime) ProtoMessage ¶
func (*StrobeTime) ProtoMessage()
func (*StrobeTime) ProtoReflect ¶
func (x *StrobeTime) ProtoReflect() protoreflect.Message
func (*StrobeTime) Reset ¶
func (x *StrobeTime) Reset()
func (*StrobeTime) Run ¶
func (n *StrobeTime) Run(ctx context.Context) error
StrobeTime changes the current system time back and forth by adding then removing the provided delta, repeatedly, in each period.
func (*StrobeTime) String ¶
func (x *StrobeTime) String() string
type UnimplementedServiceServer ¶
type UnimplementedServiceServer struct{}
UnimplementedServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedServiceServer) ConfigService ¶
func (UnimplementedServiceServer) ConfigService(context.Context, *ConfigRequest) (*emptypb.Empty, error)
func (UnimplementedServiceServer) ResetService ¶
func (UnimplementedServiceServer) ResetService(context.Context, *ResetRequest) (*emptypb.Empty, error)
func (UnimplementedServiceServer) RestartService ¶
func (UnimplementedServiceServer) RunNemesis ¶
func (UnimplementedServiceServer) RunNemesis(context.Context, *NemesisRequest) (*emptypb.Empty, error)
func (UnimplementedServiceServer) StartService ¶
func (UnimplementedServiceServer) StopService ¶
type UnsafeServiceServer ¶
type UnsafeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.