mocks

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 4 Imported by: 21 modules, 20 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockSigningManager

func NewMockSigningManager() core.SigningManager

NewMockSigningManager Constructor for a mock signing manager.

Types

type MockConfigBackend

type MockConfigBackend struct {
	//KeyValueMap map to override CustomBackend key-values.
	KeyValueMap map[string]interface{}
}

MockConfigBackend mocks config backend for unit tests

func BackendFromFile

func BackendFromFile(configPath string) (*MockConfigBackend, error)

BackendFromFile returns MockConfigBackend populated from file

func (*MockConfigBackend) Get

func (b *MockConfigBackend) Get(key string) (interface{}, bool)

Get returns a value from the backend

func (*MockConfigBackend) Lookup

func (b *MockConfigBackend) Lookup(key string) (interface{}, bool)

Lookup returns or unmarshals value for given key

func (*MockConfigBackend) Set

func (b *MockConfigBackend) Set(key string, value interface{}) bool

Set sets a backend value

type MockCoreContext

type MockCoreContext struct {
	MockConfig            core.CryptoSuiteConfig
	MockCryptoSuite       core.CryptoSuite
	MockUserStore         msp.UserStore
	MockSigningManager    core.SigningManager
	MockCryptoSuiteConfig core.CryptoSuiteConfig
}

MockCoreContext is a mock core context

func (*MockCoreContext) CryptoSuite

func (m *MockCoreContext) CryptoSuite() core.CryptoSuite

CryptoSuite ...

func (*MockCoreContext) CryptoSuiteConfig

func (m *MockCoreContext) CryptoSuiteConfig() core.CryptoSuiteConfig

CryptoSuiteConfig ...

func (*MockCoreContext) SigningManager

func (m *MockCoreContext) SigningManager() core.SigningManager

SigningManager ...

type MockSigningManager

type MockSigningManager struct {
}

MockSigningManager is mock signing manager

func (*MockSigningManager) Sign

func (mgr *MockSigningManager) Sign(object []byte, key core.Key) ([]byte, error)

Sign will sign the given object using provided key

Jump to

Keyboard shortcuts

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