service

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ConfigNS is the namespace (chaincode name) under which configuration data is stored.
	ConfigNS = "configscc"
)

Variables

View Source
var ErrConfigNotFound = errors.New("config not found")

ErrConfigNotFound indicates that the config for the given key was not found

Functions

This section is empty.

Types

type ConfigService

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

ConfigService manages configuration data for a given channel

func New

func New(channelID string, retrieverProvider state.RetrieverProvider, publisher blockPublisher) *ConfigService

New returns a new config service

func (*ConfigService) AddUpdateHandler

func (s *ConfigService) AddUpdateHandler(handler config.UpdateHandler)

AddUpdateHandler adds a handler that is notified of config updates/deletes

func (*ConfigService) Get

func (s *ConfigService) Get(key *config.Key) (*config.Value, error)

Get returns the config bytes for the given criteria. If the key is not found then ErrConfigNotFound error is returned

func (*ConfigService) Query added in v0.1.1

func (s *ConfigService) Query(criteria *config.Criteria) ([]*config.KeyValue, error)

Query retrieves configurations based on the provided criteria.

type Manager

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

Manager manages a set of configuration services - one per channel

func NewSvcMgr added in v0.1.1

func NewSvcMgr(stateDBProvider stateDBProvider, blockPublisherProvider api.BlockPublisherProvider) *Manager

NewSvcMgr creates a new config service manager

func (*Manager) ForChannel

func (c *Manager) ForChannel(channelID string) config.Service

ForChannel returns a config service for the given channel.

Jump to

Keyboard shortcuts

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