istio: Index | Files

package mock

import ""


Package Files

faketokenmanager.go xdsserver.go

func StartXDSServer Uses

func StartXDSServer(conf XDSConf, cb *XDSCallbacks, ls *DynamicListener, isTLS bool) (*grpc.Server, error)

StartXDSServer sets up a mock XDS server nolint: interfacer

type DynamicListener Uses

type DynamicListener struct {
    Port int

type FakeTokenManager Uses

type FakeTokenManager struct {
    // contains filtered or unexported fields

func CreateFakeTokenManager Uses

func CreateFakeTokenManager() *FakeTokenManager

func (*FakeTokenManager) DumpTokenStatus Uses

func (tm *FakeTokenManager) DumpTokenStatus() ([]byte, error)

DumpTokenStatus returns fake token status, or error if dumpTokenError is set.

func (*FakeTokenManager) GenerateToken Uses

func (tm *FakeTokenManager) GenerateToken(_ security.StsRequestParameters) ([]byte, error)

GenerateToken returns a fake token, or error if generateTokenError is set.

func (*FakeTokenManager) GetMetadata Uses

func (tm *FakeTokenManager) GetMetadata(forCA bool, xdsAuthProvider, token string) (map[string]string, error)

GetMetadata returns the metadata headers related to the token

func (*FakeTokenManager) SetDumpTokenError Uses

func (tm *FakeTokenManager) SetDumpTokenError(err error)

func (*FakeTokenManager) SetGenerateTokenError Uses

func (tm *FakeTokenManager) SetGenerateTokenError(err error)

func (*FakeTokenManager) SetRespStsParam Uses

func (tm *FakeTokenManager) SetRespStsParam(p stsservice.StsResponseParameters)

func (*FakeTokenManager) SetToken Uses

func (tm *FakeTokenManager) SetToken(t stsservice.TokenInfo)

type XDSCallbacks Uses

type XDSCallbacks struct {
    // contains filtered or unexported fields

func CreateXdsCallback Uses

func CreateXdsCallback(t *testing.T) *XDSCallbacks

func (*XDSCallbacks) ExpectedToken Uses

func (c *XDSCallbacks) ExpectedToken() string

func (*XDSCallbacks) NumStream Uses

func (c *XDSCallbacks) NumStream() int

func (*XDSCallbacks) NumTokenReceived Uses

func (c *XDSCallbacks) NumTokenReceived() int

func (*XDSCallbacks) OnFetchRequest Uses

func (c *XDSCallbacks) OnFetchRequest(context.Context, *discovery.DiscoveryRequest) error

func (*XDSCallbacks) OnFetchResponse Uses

func (c *XDSCallbacks) OnFetchResponse(*discovery.DiscoveryRequest, *discovery.DiscoveryResponse)

func (*XDSCallbacks) OnStreamClosed Uses

func (c *XDSCallbacks) OnStreamClosed(id int64)

func (*XDSCallbacks) OnStreamOpen Uses

func (c *XDSCallbacks) OnStreamOpen(ctx context.Context, id int64, url string) error

func (*XDSCallbacks) OnStreamRequest Uses

func (c *XDSCallbacks) OnStreamRequest(id int64, _ *discovery.DiscoveryRequest) error

func (*XDSCallbacks) OnStreamResponse Uses

func (c *XDSCallbacks) OnStreamResponse(id int64, _ *discovery.DiscoveryRequest, _ *discovery.DiscoveryResponse)

func (*XDSCallbacks) SetCallbackError Uses

func (c *XDSCallbacks) SetCallbackError(setErr bool)

func (*XDSCallbacks) SetExpectedToken Uses

func (c *XDSCallbacks) SetExpectedToken(expected string)

func (*XDSCallbacks) SetNumberOfStreamClose Uses

func (c *XDSCallbacks) SetNumberOfStreamClose(n int, d int)

SetNumberOfStreamClose force XDS server to close gRPC stream n times. Each stream will last d seconds before close.

type XDSConf Uses

type XDSConf struct {
    Port     int
    CertFile string
    KeyFile  string

XDSConf has config for XDS server

Package mock imports 26 packages (graph) and is imported by 1 packages. Updated 2021-01-16. Refresh now. Tools for package owners.