spybackend

package
v0.0.0-...-46d7da7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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 behaviour

func DefaultArgs

func DefaultArgs() *Args

DefaultArgs returns default arguments

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

	// check listEntry IBP
	HandleListEntryResult *adptModel.CheckResult
	HandleListEntryError  error

	// quota IBP
	HandleQuotaResult *adptModel.QuotaResult
	HandleQuotaError  error
}

Behavior specifies programmed behaviour

type NoSessionServer

type NoSessionServer struct {
	Behavior *Behavior
	Requests *Requests
	// 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) GetState

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

GetState returns the adapters observed state.

func (*NoSessionServer) HandleListEntry

HandleListEntry records listrequest and responds with the programmed response

func (*NoSessionServer) HandleMetric

HandleMetric records metric entries and responds with the programmed response

func (*NoSessionServer) HandleQuota

HandleQuota records quotarequest and responds with the programmed response

func (*NoSessionServer) Run

func (s *NoSessionServer) Run()

Run starts the server run

func (*NoSessionServer) Wait

func (s *NoSessionServer) Wait() error

Wait waits for server to stop

type Requests

type Requests struct {
	ValidateRequest []*adptModel.ValidateRequest

	CreateSessionRequest []*adptModel.CreateSessionRequest

	CloseSessionRequest []*adptModel.CloseSessionRequest

	HandleMetricRequest []*metric.HandleMetricRequest

	HandleListEntryRequest []*listentry.HandleListEntryRequest

	HandleQuotaRequest []*quota.HandleQuotaRequest
	// contains filtered or unexported fields
}

Requests record captured requests by the spy

type Server

type Server interface {
	Addr() net.Addr
	Close() error
	Run()
}

Server is basic server interface

func NewNoSessionServer

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

NewNoSessionServer creates a new no session server from given args.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL