Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Enable bool
}
Config defines the config structure
func (*Config) IsEnabled ¶
IsEnabled is used to return whether the current component is enabled This attribute is required in pluggable components
func (*Config) RegisterFlagsWithPrefix ¶
RegisterFlagsWithPrefix is used to register flags
type MethodDescGetter ¶
type MethodDescGetter func(method string) (*desc.MethodDescriptor, bool)
MethodDescGetter is used to obtain the MethodDescriptor corresponding to a given method
type Plugin ¶
Plugin implements Mock for gRPC request
func New ¶
func New(cfg *Config, methodDescGetter MethodDescGetter, logger logger.Logger, registerer prometheus.Registerer) (*Plugin, error)
New is used to init service
func (*Plugin) MockResponse ¶
func (s *Plugin) MockResponse(ctx context.Context, mock *v1alpha1.MockAPI_Response, request *interact.Request, response *interact.Response) (abort bool, err error)
MockResponse is used to generate interact.Response according to the given MockAPI_Response and interact.Request
Click to show internal directories.
Click to hide internal directories.