github.com/leonlxy/hyperledger@v1.0.0-alpha.0.20170427033203-34922035d248/common/mocks/config/orderer.go (about) 1 /* 2 Copyright IBM Corp. 2016 All Rights Reserved. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package config 18 19 import ( 20 "time" 21 22 ab "github.com/hyperledger/fabric/protos/orderer" 23 ) 24 25 // Orderer is a mock implementation of config.Orderer 26 type Orderer struct { 27 // ConsensusTypeVal is returned as the result of ConsensusType() 28 ConsensusTypeVal string 29 // BatchSizeVal is returned as the result of BatchSize() 30 BatchSizeVal *ab.BatchSize 31 // BatchTimeoutVal is returned as the result of BatchTimeout() 32 BatchTimeoutVal time.Duration 33 // KafkaBrokersVal is returned as the result of KafkaBrokers() 34 KafkaBrokersVal []string 35 // MaxChannelsCountVal is returns as the result of MaxChannelsCount() 36 MaxChannelsCountVal uint64 37 } 38 39 // ConsensusType returns the ConsensusTypeVal 40 func (scm *Orderer) ConsensusType() string { 41 return scm.ConsensusTypeVal 42 } 43 44 // BatchSize returns the BatchSizeVal 45 func (scm *Orderer) BatchSize() *ab.BatchSize { 46 return scm.BatchSizeVal 47 } 48 49 // BatchTimeout returns the BatchTimeoutVal 50 func (scm *Orderer) BatchTimeout() time.Duration { 51 return scm.BatchTimeoutVal 52 } 53 54 // KafkaBrokers returns the KafkaBrokersVal 55 func (scm *Orderer) KafkaBrokers() []string { 56 return scm.KafkaBrokersVal 57 } 58 59 // MaxChannelsCount returns the MaxChannelsCountVal 60 func (scm *Orderer) MaxChannelsCount() uint64 { 61 return scm.MaxChannelsCountVal 62 }