fake

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMockMemoryManager added in v0.1.1

func GetMockMemoryManager(treeErr, brokerErr error) memory.Manager

GetMockMemoryManager returns a mock for generic memory managing

func MockBrokerMemory added in v0.1.1

func MockBrokerMemory(failErr error) brokers.Manager

MockBrokerMemory mock exported with propagated error through the functions

func MockTreeMemory added in v0.1.1

func MockTreeMemory(failErr error) tree.Manager

MockTreeMemory mock exported with propagated error through the functions

Types

type Alias

type Alias struct {
	*TreeMemoryMock
	// contains filtered or unexported fields
}

Alias - mocks the implementation of the AppMemory interface methods

func (*Alias) Create

func (a *Alias) Create(query, targetBoundary string, alias *meta.Alias) error

Create - simple mock

func (*Alias) Delete

func (a *Alias) Delete(scope, aliasKey string) error

Delete - simple mock

func (*Alias) Get

func (a *Alias) Get(scope, aliasKey string) (*meta.Alias, error)

Get - simple mock

func (*Alias) Update

func (a *Alias) Update(scope, aliasKey string, alias *meta.Alias) error

Update - simple mock

type Apps

type Apps struct {
	*TreeMemoryMock
	// contains filtered or unexported fields
}

Apps - mocks the implementation of the AppMemory interface methods

func (*Apps) Create

func (a *Apps) Create(scope string, app *meta.App, brokers *apimodels.BrokersDI) error

Create - simple mock

func (*Apps) Delete

func (a *Apps) Delete(query string) error

Delete - simple mock

func (*Apps) Get

func (a *Apps) Get(query string) (*meta.App, error)

Get - simple mock

func (*Apps) ResolveBoundary

func (*Apps) ResolveBoundary(app *meta.App, usePermTree bool) (map[string]string, error)

ResolveBoundary mock

func (*Apps) Update

func (a *Apps) Update(scope string, app *meta.App, brokers *apimodels.BrokersDI) error

Update - simple mock

type BrokersMock

type BrokersMock struct {
	// contains filtered or unexported fields
}

BrokersMock is the struct with the necessary implementations to mock the interface used to manage brokers

func (*BrokersMock) Configs

func (bks *BrokersMock) Configs(broker string) (brokers.BrokerConfiguration, error)

Configs mock of configuration for broker

func (*BrokersMock) Create

func (bks *BrokersMock) Create(config brokers.BrokerConfiguration) error

Create mocks a new broker on insprd

func (*BrokersMock) Factory

func (bks *BrokersMock) Factory() memory.SidecarManager

Factory mock of factory interface

func (*BrokersMock) Get added in v0.1.1

func (bks *BrokersMock) Get() (*apimodels.BrokersDI, error)

Get returns an array containing all currently mocked brokers

func (*BrokersMock) GetDefault

func (bks *BrokersMock) GetDefault() (string, error)

GetDefault returns the broker mocked as default

func (*BrokersMock) SetDefault

func (bks *BrokersMock) SetDefault(broker string) error

SetDefault sets a previously mocked broker as the fake's default broker

type Channels

type Channels struct {
	*TreeMemoryMock
	// contains filtered or unexported fields
}

Channels - mocks the implementation of the ChannelMemory interface methods

func (*Channels) Create

func (ch *Channels) Create(scope string, channel *meta.Channel, brokers *apimodels.BrokersDI) error

Create - simple mock

func (*Channels) Delete

func (ch *Channels) Delete(scope, name string) error

Delete - simple mock

func (*Channels) Get

func (ch *Channels) Get(scope, name string) (*meta.Channel, error)

Get - simple mock

func (*Channels) Update

func (ch *Channels) Update(scope string, channel *meta.Channel) error

Update - simple mock

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

Factory mock of AbsstractBrokersFactory

func (*Factory) Get

func (f *Factory) Get(broker string) (models.SidecarFactory, error)

Get mock of factory get method

func (*Factory) Subscribe

func (f *Factory) Subscribe(broker string, factory models.SidecarFactory) error

Subscribe mock of factory subscription method

type LookupMemManager

type LookupMemManager TreeMemoryMock

LookupMemManager mocks getter for roots

func (LookupMemManager) Alias

Alias mocks a alias getter

func (LookupMemManager) Apps

Apps mocks an app getter

func (LookupMemManager) Channels

Channels mocks a channel getter

func (LookupMemManager) Types

Types mocks a Type getter

type MemoryMock added in v0.1.1

type MemoryMock struct {
	// contains filtered or unexported fields
}

MemoryMock is the struct with the necessary implementations to mock the interface used to manage memory

func (*MemoryMock) Brokers added in v0.1.1

func (mm *MemoryMock) Brokers() brokers.Manager

Brokers returns a broker memory mocked manager

func (*MemoryMock) Tree added in v0.1.1

func (mm *MemoryMock) Tree() tree.Manager

Tree returns a tree memory mocked manager

type TreeMemoryMock added in v0.1.1

type TreeMemoryMock struct {
	// contains filtered or unexported fields
}

TreeMemoryMock is the api struct with the necessary implementations to satisfy the interface used in the routes established

func (*TreeMemoryMock) Alias added in v0.1.1

func (mm *TreeMemoryMock) Alias() tree.AliasMemory

Alias returns manager's Alias

func (*TreeMemoryMock) Apps added in v0.1.1

func (mm *TreeMemoryMock) Apps() tree.AppMemory

Apps returns manager of DApps

func (*TreeMemoryMock) Cancel added in v0.1.1

func (mm *TreeMemoryMock) Cancel()

Cancel mock interface structure

func (*TreeMemoryMock) Channels added in v0.1.1

func (mm *TreeMemoryMock) Channels() tree.ChannelMemory

Channels returns manager's DApp

func (*TreeMemoryMock) Commit added in v0.1.1

func (mm *TreeMemoryMock) Commit()

Commit mock interface structure

func (*TreeMemoryMock) GetTransactionChanges added in v0.1.1

func (mm *TreeMemoryMock) GetTransactionChanges() (diff.Changelog, error)

GetTransactionChanges mock interface structure

func (*TreeMemoryMock) InitTransaction added in v0.1.1

func (mm *TreeMemoryMock) InitTransaction()

InitTransaction mock interface structure

func (*TreeMemoryMock) Perm added in v0.1.1

func (mm *TreeMemoryMock) Perm() tree.GetInterface

Perm mocks a root getter interface

func (*TreeMemoryMock) Types added in v0.1.1

func (mm *TreeMemoryMock) Types() tree.TypeMemory

Types returns manager's DApp

type Types

type Types struct {
	*TreeMemoryMock
	// contains filtered or unexported fields
}

Types - mocks the implementation of the TypeMemory interface methods

func (*Types) Create

func (t *Types) Create(scope string, tp *meta.Type) error

Create - simple mock

func (*Types) Delete

func (t *Types) Delete(scope, name string) error

Delete - simple mock

func (*Types) Get

func (t *Types) Get(scope, name string) (*meta.Type, error)

Get - simple mock

func (*Types) Update

func (t *Types) Update(scope string, tp *meta.Type) error

Update - simple mock

Jump to

Keyboard shortcuts

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