Documentation
¶
Index ¶
- type Config
- type Manager
- func (s *Manager) DeleteMockAPI(ctx context.Context, request *v1alpha1.DeleteMockAPIRequest) (*v1alpha1.DeleteMockAPIResponse, error)
- func (s *Manager) ListMockAPI(ctx context.Context, request *v1alpha1.ListMockAPIRequest) (*v1alpha1.ListMockAPIResponse, error)
- func (s *Manager) MatchAPI(host, path, method string) (*v1alpha1.MockAPI, bool)
- func (s *Manager) MockResponse(ctx context.Context, request *interact.Request) (*interact.Response, error)
- func (s *Manager) SaveMockAPI(ctx context.Context, request *v1alpha1.SaveMockAPIRequest) (*v1alpha1.SaveMockAPIResponse, error)
- func (s *Manager) Start(ctx context.Context, cancelFunc context.CancelFunc) error
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config defines the config structure
func (*Config) RegisterFlagsWithPrefix ¶
RegisterFlagsWithPrefix is used to register flags
type Manager ¶
type Manager struct { v1alpha1.UnimplementedMockServer logger.Logger // contains filtered or unexported fields }
Manager is the implement of APIManager
func (*Manager) DeleteMockAPI ¶
func (s *Manager) DeleteMockAPI(ctx context.Context, request *v1alpha1.DeleteMockAPIRequest) (*v1alpha1.DeleteMockAPIResponse, error)
DeleteMockAPI is used to delete MockAPI
func (*Manager) ListMockAPI ¶
func (s *Manager) ListMockAPI(ctx context.Context, request *v1alpha1.ListMockAPIRequest) (*v1alpha1.ListMockAPIResponse, error)
ListMockAPI is used to list MockAPIs
func (*Manager) MockResponse ¶
func (s *Manager) MockResponse(ctx context.Context, request *interact.Request) (*interact.Response, error)
MockResponse is used to mock response
func (*Manager) SaveMockAPI ¶
func (s *Manager) SaveMockAPI(ctx context.Context, request *v1alpha1.SaveMockAPIRequest) (*v1alpha1.SaveMockAPIResponse, error)
SaveMockAPI is used to create or update MockAPI
type Provider ¶
type Provider interface { v1alpha1.MockServer MockResponse(ctx context.Context, request *interact.Request) (*interact.Response, error) Start(ctx context.Context, cancelFunc context.CancelFunc) error }
Provider defines the APIManager interface It is used to manage MockAPI, plug-ins, and generate MockResponse
func New ¶
func New(cfg *Config, pluginRegistry pluginregistry.Registry, logger logger.Logger, registerer prometheus.Registerer) (Provider, error)
New is used to init service
Click to show internal directories.
Click to hide internal directories.