Documentation ¶
Index ¶
- type Handler
- func (h Handler) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (h Handler) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (h Handler) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
- func (h Handler) ConvertObjects(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
- func (h Handler) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
- func (h Handler) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (h Handler) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (h Handler) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (h Handler) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- func (h Handler) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
- type HandlerMiddlewareTest
- type HandlerMiddlewareTestOption
- func WithMiddlewares(middlewares ...backend.HandlerMiddleware) HandlerMiddlewareTestOption
- func WithResourceResponses(responses []*backend.CallResourceResponse) HandlerMiddlewareTestOption
- func WithRunStreamBytesResponses(responses [][]byte) HandlerMiddlewareTestOption
- func WithRunStreamJSONResponses(responses [][]byte) HandlerMiddlewareTestOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct { QueryDataFunc backend.QueryDataHandlerFunc CallResourceFunc backend.CallResourceHandlerFunc CheckHealthFunc backend.CheckHealthHandlerFunc CollectMetricsFunc backend.CollectMetricsHandlerFunc SubscribeStreamFunc backend.SubscribeStreamHandlerFunc PublishStreamFunc backend.PublishStreamHandlerFunc RunStreamFunc backend.RunStreamHandlerFunc MutateAdmissionFunc backend.MutateAdmissionFunc ValidateAdmissionFunc backend.ValidateAdmissionFunc ConvertObjectsFunc backend.ConvertObjectsFunc }
Handler a test handler implementing backend.Handler.
func (Handler) CallResource ¶
func (h Handler) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (Handler) CheckHealth ¶
func (h Handler) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (Handler) CollectMetrics ¶
func (h Handler) CollectMetrics(ctx context.Context, req *backend.CollectMetricsRequest) (*backend.CollectMetricsResult, error)
func (Handler) ConvertObjects ¶
func (h Handler) ConvertObjects(ctx context.Context, req *backend.ConversionRequest) (*backend.ConversionResponse, error)
func (Handler) MutateAdmission ¶
func (h Handler) MutateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.MutationResponse, error)
func (Handler) PublishStream ¶
func (h Handler) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
func (Handler) QueryData ¶
func (h Handler) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (Handler) RunStream ¶
func (h Handler) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (Handler) SubscribeStream ¶
func (h Handler) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
func (Handler) ValidateAdmission ¶
func (h Handler) ValidateAdmission(ctx context.Context, req *backend.AdmissionRequest) (*backend.ValidationResponse, error)
type HandlerMiddlewareTest ¶
type HandlerMiddlewareTest struct { T *testing.T TestHandler *Handler Middlewares []backend.HandlerMiddleware MiddlewareHandler *backend.MiddlewareHandler QueryDataReq *backend.QueryDataRequest QueryDataCtx context.Context CallResourceReq *backend.CallResourceRequest CallResourceCtx context.Context CheckHealthReq *backend.CheckHealthRequest CheckHealthCtx context.Context CollectMetricsReq *backend.CollectMetricsRequest CollectMetricsCtx context.Context SubscribeStreamReq *backend.SubscribeStreamRequest SubscribeStreamCtx context.Context PublishStreamReq *backend.PublishStreamRequest PublishStreamCtx context.Context RunStreamReq *backend.RunStreamRequest RunStreamCtx context.Context MutateAdmissionReq *backend.AdmissionRequest MutateAdmissionCtx context.Context ValidationAdmissionReq *backend.AdmissionRequest ValidateAdmissionCtx context.Context ConvertObjectReq *backend.ConversionRequest ConvertObjectCtx context.Context // contains filtered or unexported fields }
func NewHandlerMiddlewareTest ¶
func NewHandlerMiddlewareTest(t *testing.T, opts ...HandlerMiddlewareTestOption) *HandlerMiddlewareTest
type HandlerMiddlewareTestOption ¶
type HandlerMiddlewareTestOption func(*HandlerMiddlewareTest)
func WithMiddlewares ¶
func WithMiddlewares(middlewares ...backend.HandlerMiddleware) HandlerMiddlewareTestOption
WithMiddlewares HandlerMiddlewareTestOption option to append middlewares to HandlerMiddlewareTest.
func WithResourceResponses ¶
func WithResourceResponses(responses []*backend.CallResourceResponse) HandlerMiddlewareTestOption
WithResourceResponses can be used to make the test client send simulated resource responses back over the sender stream.
func WithRunStreamBytesResponses ¶
func WithRunStreamBytesResponses(responses [][]byte) HandlerMiddlewareTestOption
WithRunStreamBytesResponses can be used to make the test client send simulated bytes responses back over the sender stream.
func WithRunStreamJSONResponses ¶
func WithRunStreamJSONResponses(responses [][]byte) HandlerMiddlewareTestOption
WithRunStreamJSONResponses can be used to make the test client send simulated JSON responses back over the sender stream.
Click to show internal directories.
Click to hide internal directories.