istio: istio.io/istio/mixer/test/spybackend Index | Files

package spybackend

import "istio.io/istio/mixer/test/spybackend"

Index

Package Files

args.go nosession.go session.go

type Args Uses

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

func DefaultArgs Uses

func DefaultArgs() *Args

DefaultArgs returns default arguments

type Behavior Uses

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

    // Auth
    HeaderKey                string
    HeaderToken              string
    CredsPath                string
    KeyPath                  string
    CertPath                 string
    InsecureSkipVerification bool
    RequireTLS               bool
    RequireMTls              bool
}

Behavior specifies programmed behavior

type NoSessionServer Uses

type NoSessionServer struct {
    Behavior      *Behavior
    Requests      *Requests
    CapturedCalls []spyadapter.CapturedCall
    // contains filtered or unexported fields
}

NoSessionServer models no session adapter backend.

func (*NoSessionServer) Addr Uses

func (s *NoSessionServer) Addr() net.Addr

Addr returns the listening address of the server

func (*NoSessionServer) Close Uses

func (s *NoSessionServer) Close() error

Close gracefully shuts down the server

func (*NoSessionServer) GetCapturedCalls Uses

func (s *NoSessionServer) GetCapturedCalls() []spyadapter.CapturedCall

func (*NoSessionServer) GetState Uses

func (s *NoSessionServer) GetState() interface{}

GetState returns the adapters observed state.

func (*NoSessionServer) HandleCheckProducer Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (s *NoSessionServer) HandleSampleReport(c context.Context, r *samplereport.HandleSampleReportRequest) (*adptModel.ReportResult, error)

HandleSampleReport records samplereport and responds with the programmed response

func (*NoSessionServer) Run Uses

func (s *NoSessionServer) Run()

Run starts the server run

func (*NoSessionServer) Wait Uses

func (s *NoSessionServer) Wait() error

Wait waits for server to stop

type Requests Uses

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 Uses

type Server interface {
    Addr() net.Addr
    Close() error
    Run()
    GetCapturedCalls() []spyadapter.CapturedCall
}

Server is basic server interface

func NewNoSessionServer Uses

func NewNoSessionServer(a *Args) (Server, error)

NewNoSessionServer creates a new no session server from given args.

Package spybackend imports 24 packages (graph). Updated 2019-10-12. Refresh now. Tools for package owners.