Documentation ¶
Index ¶
- type Args
- type Behavior
- type NoSessionServer
- func (s *NoSessionServer) Addr() net.Addr
- func (s *NoSessionServer) Close() error
- func (s *NoSessionServer) GetCapturedCalls() []spyadapter.CapturedCall
- func (s *NoSessionServer) GetState() interface{}
- func (s *NoSessionServer) HandleCheckProducer(c context.Context, r *checkoutputTmpl.HandleCheckProducerRequest) (*checkoutputTmpl.HandleCheckProducerResponse, error)
- func (s *NoSessionServer) HandleListEntry(c context.Context, r *listentry.HandleListEntryRequest) (*adptModel.CheckResult, error)
- func (s *NoSessionServer) HandleMetric(c context.Context, r *metric.HandleMetricRequest) (*adptModel.ReportResult, error)
- func (s *NoSessionServer) HandleQuota(c context.Context, r *quota.HandleQuotaRequest) (*adptModel.QuotaResult, error)
- func (s *NoSessionServer) HandleSampleApa(c context.Context, r *sampleapa.HandleSampleApaRequest) (*sampleapa.OutputMsg, error)
- func (s *NoSessionServer) HandleSampleCheck(c context.Context, r *samplecheck.HandleSampleCheckRequest) (*adptModel.CheckResult, error)
- func (s *NoSessionServer) HandleSampleQuota(c context.Context, r *samplequota.HandleSampleQuotaRequest) (*adptModel.QuotaResult, error)
- func (s *NoSessionServer) HandleSampleReport(c context.Context, r *samplereport.HandleSampleReportRequest) (*adptModel.ReportResult, error)
- func (s *NoSessionServer) Run()
- func (s *NoSessionServer) Wait() error
- type Requests
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Args ¶
type Args struct { // manipulate the behavior of the backend. Behavior *Behavior // observed inputs by the backend Requests *Requests }
Args specify captured requests and programmed behavior
type Behavior ¶
type Behavior struct { ValidateResponse *adptModel.ValidateResponse ValidateError error CreateSessionResponse *adptModel.CreateSessionResponse CreateSessionError error CloseSessionResponse *adptModel.CloseSessionResponse CloseSessionError error // report metric IBP HandleMetricResult *adptModel.ReportResult HandleMetricError error HandleMetricSleep time.Duration // check listEntry IBP HandleListEntryResult *adptModel.CheckResult HandleListEntryError error HandleListEntrySleep time.Duration // quota IBP HandleQuotaResult *adptModel.QuotaResult HandleQuotaError error HandleQuotaSleep time.Duration // sample quota IBP HandleSampleQuotaResult *adptModel.QuotaResult HandleSampleQuotaError error HandleSampleQuotaSleep time.Duration // sample check IBP HandleSampleCheckResult *adptModel.CheckResult HandleSampleCheckError error HandleCheckOutput *checkoutputTmpl.OutputMsg HandleSampleCheckSleep time.Duration // sample report IBP HandleSampleReportResult *adptModel.ReportResult HandleSampleReportError error HandleSampleReportSleep time.Duration // sample APA IBP HandleSampleApaResult *apaTmpl.OutputMsg HandleSampleApaError error HandleSampleApaSleep time.Duration }
Behavior specifies programmed behavior
type NoSessionServer ¶
type NoSessionServer struct { Behavior *Behavior Requests *Requests CapturedCalls []spyadapter.CapturedCall // contains filtered or unexported fields }
NoSessionServer models no session adapter backend.
func (*NoSessionServer) Addr ¶
func (s *NoSessionServer) Addr() net.Addr
Addr returns the listening address of the server
func (*NoSessionServer) Close ¶
func (s *NoSessionServer) Close() error
Close gracefully shuts down the server
func (*NoSessionServer) GetCapturedCalls ¶
func (s *NoSessionServer) GetCapturedCalls() []spyadapter.CapturedCall
GetCapturedCalls ...
func (*NoSessionServer) GetState ¶
func (s *NoSessionServer) GetState() interface{}
GetState returns the adapters observed state.
func (*NoSessionServer) HandleCheckProducer ¶
func (s *NoSessionServer) HandleCheckProducer(c context.Context, r *checkoutputTmpl.HandleCheckProducerRequest) (*checkoutputTmpl.HandleCheckProducerResponse, error)
HandleCheckProducer records checkoutput and responds with the programmed response
func (*NoSessionServer) HandleListEntry ¶
func (s *NoSessionServer) HandleListEntry(c context.Context, r *listentry.HandleListEntryRequest) (*adptModel.CheckResult, error)
HandleListEntry records listrequest and responds with the programmed response
func (*NoSessionServer) HandleMetric ¶
func (s *NoSessionServer) HandleMetric(c context.Context, r *metric.HandleMetricRequest) (*adptModel.ReportResult, error)
HandleMetric records metric entries and responds with the programmed response
func (*NoSessionServer) HandleQuota ¶
func (s *NoSessionServer) HandleQuota(c context.Context, r *quota.HandleQuotaRequest) (*adptModel.QuotaResult, error)
HandleQuota records quotarequest and responds with the programmed response
func (*NoSessionServer) HandleSampleApa ¶
func (s *NoSessionServer) HandleSampleApa(c context.Context, r *sampleapa.HandleSampleApaRequest) (*sampleapa.OutputMsg, error)
HandleSampleApa records sampleapa and responds with the programmed response
func (*NoSessionServer) HandleSampleCheck ¶
func (s *NoSessionServer) HandleSampleCheck(c context.Context, r *samplecheck.HandleSampleCheckRequest) (*adptModel.CheckResult, error)
HandleSampleCheck records samplecheck and responds with the programmed response
func (*NoSessionServer) HandleSampleQuota ¶
func (s *NoSessionServer) HandleSampleQuota(c context.Context, r *samplequota.HandleSampleQuotaRequest) (*adptModel.QuotaResult, error)
HandleSampleQuota records samplequota and responds with the programmed response
func (*NoSessionServer) HandleSampleReport ¶
func (s *NoSessionServer) HandleSampleReport(c context.Context, r *samplereport.HandleSampleReportRequest) (*adptModel.ReportResult, error)
HandleSampleReport records samplereport and responds with the programmed response
type Requests ¶
type Requests struct { ValidateRequest []*adptModel.ValidateRequest CreateSessionRequest []*adptModel.CreateSessionRequest CloseSessionRequest []*adptModel.CloseSessionRequest HandleMetricRequest []*metric.HandleMetricRequest HandleListEntryRequest []*listentry.HandleListEntryRequest HandleQuotaRequest []*quota.HandleQuotaRequest HandleSampleCheckRequest []*checkTmpl.HandleSampleCheckRequest HandleSampleQuotaRequest []*quotaTmpl.HandleSampleQuotaRequest HandleSampleReportRequest []*reportTmpl.HandleSampleReportRequest HandleSampleApaRequest []*apaTmpl.HandleSampleApaRequest // contains filtered or unexported fields }
Requests record captured requests by the spy
type Server ¶
type Server interface { Addr() net.Addr Close() error Run() GetCapturedCalls() []spyadapter.CapturedCall }
Server is basic server interface
func NewNoSessionServer ¶
NewNoSessionServer creates a new no session server from given args.