Documentation
¶
Overview ¶
Package config defines base configs.
Index ¶
- Variables
- func IfNotNil(v interface{}, f func() error) error
- func LoadBSONEncoderContextValue(ctx context.Context, l **bsonenc.Encoder) error
- func LoadConfigContextValue(ctx context.Context, l *LocalNode) error
- func LoadDiscoveryURLsContextValue(ctx context.Context, l *[]*url.URL) error
- func LoadEncodersContextValue(ctx context.Context, l **encoder.Encoders) error
- func LoadJSONEncoderContextValue(ctx context.Context, l **jsonenc.Encoder) error
- func LoadLogContextValue(ctx context.Context, l **logging.Logging) error
- func LoadNetworkLogContextValue(ctx context.Context, l **logging.Logging) error
- func NewChecker(ctx context.Context) (*checker, error)
- func NewValidator(ctx context.Context) (*validator, error)
- func ParseMap(m map[string]interface{}, key string, allowEmpty bool) (map[string]interface{}, error)
- func ParseType(m map[string]interface{}, allowEmpty bool) (string, error)
- type BaseBlockdata
- type BaseDatabase
- type BaseLocalConfigJSONPacker
- type BaseLocalConfigYAMLPacker
- type BaseLocalNetwork
- func (no BaseLocalNetwork) Bind() *url.URL
- func (no BaseLocalNetwork) Cache() *url.URL
- func (no BaseLocalNetwork) Certs() []tls.Certificate
- func (no BaseLocalNetwork) MarshalJSON() ([]byte, error)
- func (no BaseLocalNetwork) MarshalYAML() (interface{}, error)
- func (no BaseLocalNetwork) RateLimit() RateLimit
- func (no BaseLocalNetwork) SealCache() *url.URL
- func (no *BaseLocalNetwork) SetBind(s string) error
- func (no *BaseLocalNetwork) SetCache(s string) error
- func (no *BaseLocalNetwork) SetCerts(certs []tls.Certificate) error
- func (no *BaseLocalNetwork) SetRateLimit(s RateLimit) error
- func (no *BaseLocalNetwork) SetSealCache(s string) error
- type BaseLocalNetworkPackerJSON
- type BaseLocalNetworkPackerYAML
- type BaseLocalNode
- func (no BaseLocalNode) Address() base.Address
- func (no BaseLocalNode) GenesisOperations() []operation.Operation
- func (no BaseLocalNode) LocalConfig() LocalConfig
- func (no BaseLocalNode) MarshalJSON() ([]byte, error)
- func (no BaseLocalNode) Network() LocalNetwork
- func (no BaseLocalNode) NetworkID() base.NetworkID
- func (no BaseLocalNode) Nodes() []RemoteNode
- func (no BaseLocalNode) Policy() Policy
- func (no BaseLocalNode) Privatekey() key.Privatekey
- func (no BaseLocalNode) ProposalProcessor() ProposalProcessor
- func (no *BaseLocalNode) SetAddress(s string) error
- func (no *BaseLocalNode) SetGenesisOperations(ops []operation.Operation) error
- func (no *BaseLocalNode) SetLocalConfig(s LocalConfig) error
- func (no *BaseLocalNode) SetNetwork(n LocalNetwork) error
- func (no *BaseLocalNode) SetNetworkID(s string) error
- func (no *BaseLocalNode) SetNodes(nodes []RemoteNode) error
- func (no *BaseLocalNode) SetPolicy(p Policy) error
- func (no *BaseLocalNode) SetPrivatekey(s string) error
- func (no *BaseLocalNode) SetProposalProcessor(pp ProposalProcessor) error
- func (no *BaseLocalNode) SetStorage(st Storage) error
- func (no *BaseLocalNode) SetSuffrage(sf Suffrage) error
- func (no BaseLocalNode) Source() map[string]interface{}
- func (no BaseLocalNode) Storage() Storage
- func (no BaseLocalNode) Suffrage() Suffrage
- type BaseLocalNodePackerJSON
- type BaseLocalNodePackerYAML
- type BaseNodeNetwork
- type BasePolicy
- func (no BasePolicy) IntervalBroadcastingACCEPTBallot() time.Duration
- func (no BasePolicy) IntervalBroadcastingINITBallot() time.Duration
- func (no BasePolicy) IntervalBroadcastingProposal() time.Duration
- func (no BasePolicy) MarshalJSON() ([]byte, error)
- func (no BasePolicy) MarshalYAML() (interface{}, error)
- func (no *BasePolicy) MaxOperationsInProposal() uint
- func (no *BasePolicy) MaxOperationsInSeal() uint
- func (no BasePolicy) NetworkConnectionTimeout() time.Duration
- func (no *BasePolicy) SetIntervalBroadcastingACCEPTBallot(s string) error
- func (no *BasePolicy) SetIntervalBroadcastingINITBallot(s string) error
- func (no *BasePolicy) SetIntervalBroadcastingProposal(s string) error
- func (no *BasePolicy) SetMaxOperationsInProposal(m uint) error
- func (no *BasePolicy) SetMaxOperationsInSeal(m uint) error
- func (no *BasePolicy) SetNetworkConnectionTimeout(s string) error
- func (no *BasePolicy) SetThresholdRatio(s float64) error
- func (no *BasePolicy) SetTimeoutWaitingProposal(s string) error
- func (no *BasePolicy) SetTimespanValidBallot(s string) error
- func (no *BasePolicy) SetWaitBroadcastingACCEPTBallot(s string) error
- func (no BasePolicy) ThresholdRatio() base.ThresholdRatio
- func (no BasePolicy) TimeoutWaitingProposal() time.Duration
- func (no BasePolicy) TimespanValidBallot() time.Duration
- func (no BasePolicy) WaitBroadcastingACCEPTBallot() time.Duration
- type BasePolicyPackerJSON
- type BasePolicyPackerYAML
- type BaseRateLimit
- func (no BaseRateLimit) Cache() *url.URL
- func (no BaseRateLimit) MarshalJSON() ([]byte, error)
- func (no BaseRateLimit) MarshalYAML() (interface{}, error)
- func (no *BaseRateLimit) Preset() map[string]RateLimitRules
- func (no *BaseRateLimit) Rules() []RateLimitTargetRule
- func (no *BaseRateLimit) SetCache(s string) error
- func (no *BaseRateLimit) SetPreset(preset map[string]RateLimitRules) error
- func (no *BaseRateLimit) SetRules(rules []RateLimitTargetRule) error
- type BaseRateLimitRules
- type BaseRateLimitTargetRule
- func (no *BaseRateLimitTargetRule) IPNet() *net.IPNet
- func (no BaseRateLimitTargetRule) MarshalJSON() ([]byte, error)
- func (no BaseRateLimitTargetRule) MarshalYAML() (interface{}, error)
- func (no *BaseRateLimitTargetRule) Preset() string
- func (no *BaseRateLimitTargetRule) SetIPNet(s string) error
- func (no *BaseRateLimitTargetRule) Target() string
- type BaseRemoteNode
- func (no BaseRemoteNode) Address() base.Address
- func (no BaseRemoteNode) ConnInfo() network.ConnInfo
- func (no BaseRemoteNode) MarshalJSON() ([]byte, error)
- func (no BaseRemoteNode) Publickey() key.Publickey
- func (no *BaseRemoteNode) SetAddress(s string) error
- func (no *BaseRemoteNode) SetConnInfo(s string, insecure bool) error
- func (no *BaseRemoteNode) SetPublickey(s string) error
- type BaseRemoteNodePackerJSON
- type BaseStorage
- func (no BaseStorage) Blockdata() Blockdata
- func (no BaseStorage) Database() Database
- func (no BaseStorage) MarshalJSON() ([]byte, error)
- func (no BaseStorage) MarshalYAML() (interface{}, error)
- func (no *BaseStorage) SetBlockdata(bs Blockdata) error
- func (no *BaseStorage) SetDatabase(database Database) error
- type BaseStoragePackerJSON
- type BaseStoragePackerYAML
- type Blockdata
- type BlockdataPackerJSON
- type BlockdataPackerYAML
- type Database
- type DatabasePackerJSON
- type DatabasePackerYAML
- type DefaultLocalConfig
- func (no DefaultLocalConfig) MarshalJSON() ([]byte, error)
- func (no DefaultLocalConfig) MarshalYAML() (interface{}, error)
- func (no *DefaultLocalConfig) SetSyncInterval(s string) error
- func (no *DefaultLocalConfig) SetTimeServer(s string) error
- func (no *DefaultLocalConfig) SyncInterval() time.Duration
- func (no *DefaultLocalConfig) TimeServer() string
- type DefaultProposalProcessor
- type EmptySuffrage
- type ErrorPoint
- type ErrorPointYAML
- type ErrorProposalProcessor
- type ErrorType
- type FixedSuffrage
- type LocalConfig
- type LocalNetwork
- type LocalNode
- type Node
- type Policy
- type ProposalProcessor
- type RateLimit
- type RateLimitChecker
- type RateLimitRules
- type RateLimitTargetRule
- type RemoteNode
- type RoundrobinSuffrage
- type Storage
- type Suffrage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ContextValueConfig util.ContextKey = "config" ContextValueEncoders util.ContextKey = "encoders" ContextValueJSONEncoder util.ContextKey = "json_encoder" ContextValueBSONEncoder util.ContextKey = "bson_encoder" ContextValueLog util.ContextKey = "log" ContextValueNetworkLog util.ContextKey = "network_log" ContextValueDiscoveryURLs util.ContextKey = "discovery-urls" )
View Source
var ( DefaultSyncInterval = time.Second * 10 DefaultTimeServer = "time.google.com" )
View Source
var ( DefaultLocalNetworkURL = &url.URL{Scheme: "https", Host: "127.0.0.1:54321"} DefaultLocalNetworkBind = &url.URL{Scheme: "https", Host: "0.0.0.0:54321"} DefaultLocalNetworkCache = "gcache:?type=lru&size=100&expire=3s" DefaultLocalNetworkSealCache = "gcache:?type=lru&size=10000&expire=3m" )
View Source
var ( DefaultBlockdataPath = "./blockdata" DefaultDatabaseURI = "mongodb://127.0.0.1:27017/mitum" DefaultDatabaseCache = fmt.Sprintf( "gcache:?type=%s&size=%d&expire=%s", cache.DefaultGCacheType, cache.DefaultGCacheSize, cache.DefaultCacheExpire.String(), ) DefaultDatabaseCacheURL *url.URL )
View Source
var DefaultRateLimitTargetRules []RateLimitTargetRule
View Source
var DefaultSuffrageRateLimit = map[string]limiter.Rate{ "operations": {Period: time.Second * 10, Limit: 100}, "send-seal": {Period: time.Second * 10, Limit: 1000}, "blockdata-maps": {Period: time.Second * 10, Limit: 1000}, "blockdata": {Period: time.Second * 10, Limit: 1000}, "node-info": {Period: time.Second * 10, Limit: 50}, }
View Source
var DefaultWorldRateLimit = map[string]limiter.Rate{ "operations": {Period: time.Second * 10, Limit: 30}, "send-seal": {Period: time.Second * 10, Limit: 100}, "blockdata-maps": {Period: time.Minute * 1, Limit: 60 * 9}, "blockdata": {Period: time.Minute * 1, Limit: 60 * 9}, "node-info": {Period: time.Second * 10, Limit: 10}, }
View Source
var RateLimitHandlerMap = map[string]string{ "operations": quicnetwork.QuicHandlerPathGetStagedOperations, "send-seal": quicnetwork.QuicHandlerPathSendSeal, "blockdata-maps": quicnetwork.QuicHandlerPathGetBlockdataMaps, "blockdata": quicnetwork.QuicHandlerPathGetBlockdataPattern, "node-info": quicnetwork.QuicHandlerPathNodeInfo, }
Functions ¶
func NewChecker ¶
func NewValidator ¶
Types ¶
type BaseBlockdata ¶
type BaseBlockdata struct {
// contains filtered or unexported fields
}
func (BaseBlockdata) Path ¶
func (no BaseBlockdata) Path() string
func (*BaseBlockdata) SetPath ¶
func (no *BaseBlockdata) SetPath(s string) error
type BaseDatabase ¶
type BaseDatabase struct {
// contains filtered or unexported fields
}
func (BaseDatabase) Cache ¶
func (no BaseDatabase) Cache() *url.URL
func (*BaseDatabase) SetCache ¶
func (no *BaseDatabase) SetCache(s string) error
func (*BaseDatabase) SetURI ¶
func (no *BaseDatabase) SetURI(s string) error
func (BaseDatabase) URI ¶
func (no BaseDatabase) URI() *url.URL
type BaseLocalNetwork ¶
type BaseLocalNetwork struct { *BaseNodeNetwork // contains filtered or unexported fields }
func EmptyBaseLocalNetwork ¶
func EmptyBaseLocalNetwork() *BaseLocalNetwork
func (BaseLocalNetwork) Bind ¶
func (no BaseLocalNetwork) Bind() *url.URL
func (BaseLocalNetwork) Cache ¶
func (no BaseLocalNetwork) Cache() *url.URL
func (BaseLocalNetwork) Certs ¶
func (no BaseLocalNetwork) Certs() []tls.Certificate
func (BaseLocalNetwork) MarshalJSON ¶
func (no BaseLocalNetwork) MarshalJSON() ([]byte, error)
func (BaseLocalNetwork) MarshalYAML ¶
func (no BaseLocalNetwork) MarshalYAML() (interface{}, error)
func (BaseLocalNetwork) RateLimit ¶
func (no BaseLocalNetwork) RateLimit() RateLimit
func (BaseLocalNetwork) SealCache ¶
func (no BaseLocalNetwork) SealCache() *url.URL
func (*BaseLocalNetwork) SetBind ¶
func (no *BaseLocalNetwork) SetBind(s string) error
func (*BaseLocalNetwork) SetCache ¶
func (no *BaseLocalNetwork) SetCache(s string) error
func (*BaseLocalNetwork) SetCerts ¶
func (no *BaseLocalNetwork) SetCerts(certs []tls.Certificate) error
func (*BaseLocalNetwork) SetRateLimit ¶
func (no *BaseLocalNetwork) SetRateLimit(s RateLimit) error
func (*BaseLocalNetwork) SetSealCache ¶
func (no *BaseLocalNetwork) SetSealCache(s string) error
type BaseLocalNode ¶
type BaseLocalNode struct {
// contains filtered or unexported fields
}
func NewBaseLocalNode ¶
func NewBaseLocalNode(enc encoder.Encoder, source map[string]interface{}) *BaseLocalNode
func (BaseLocalNode) Address ¶
func (no BaseLocalNode) Address() base.Address
func (BaseLocalNode) GenesisOperations ¶
func (no BaseLocalNode) GenesisOperations() []operation.Operation
func (BaseLocalNode) LocalConfig ¶
func (no BaseLocalNode) LocalConfig() LocalConfig
func (BaseLocalNode) MarshalJSON ¶
func (no BaseLocalNode) MarshalJSON() ([]byte, error)
func (BaseLocalNode) Network ¶
func (no BaseLocalNode) Network() LocalNetwork
func (BaseLocalNode) NetworkID ¶
func (no BaseLocalNode) NetworkID() base.NetworkID
func (BaseLocalNode) Nodes ¶
func (no BaseLocalNode) Nodes() []RemoteNode
func (BaseLocalNode) Policy ¶
func (no BaseLocalNode) Policy() Policy
func (BaseLocalNode) Privatekey ¶
func (no BaseLocalNode) Privatekey() key.Privatekey
func (BaseLocalNode) ProposalProcessor ¶
func (no BaseLocalNode) ProposalProcessor() ProposalProcessor
func (*BaseLocalNode) SetAddress ¶
func (no *BaseLocalNode) SetAddress(s string) error
func (*BaseLocalNode) SetGenesisOperations ¶
func (no *BaseLocalNode) SetGenesisOperations(ops []operation.Operation) error
func (*BaseLocalNode) SetLocalConfig ¶
func (no *BaseLocalNode) SetLocalConfig(s LocalConfig) error
func (*BaseLocalNode) SetNetwork ¶
func (no *BaseLocalNode) SetNetwork(n LocalNetwork) error
func (*BaseLocalNode) SetNetworkID ¶
func (no *BaseLocalNode) SetNetworkID(s string) error
func (*BaseLocalNode) SetNodes ¶
func (no *BaseLocalNode) SetNodes(nodes []RemoteNode) error
func (*BaseLocalNode) SetPolicy ¶
func (no *BaseLocalNode) SetPolicy(p Policy) error
func (*BaseLocalNode) SetPrivatekey ¶
func (no *BaseLocalNode) SetPrivatekey(s string) error
func (*BaseLocalNode) SetProposalProcessor ¶
func (no *BaseLocalNode) SetProposalProcessor(pp ProposalProcessor) error
func (*BaseLocalNode) SetStorage ¶
func (no *BaseLocalNode) SetStorage(st Storage) error
func (*BaseLocalNode) SetSuffrage ¶
func (no *BaseLocalNode) SetSuffrage(sf Suffrage) error
func (BaseLocalNode) Source ¶
func (no BaseLocalNode) Source() map[string]interface{}
func (BaseLocalNode) Storage ¶
func (no BaseLocalNode) Storage() Storage
func (BaseLocalNode) Suffrage ¶
func (no BaseLocalNode) Suffrage() Suffrage
type BaseLocalNodePackerJSON ¶
type BaseLocalNodePackerJSON struct { Address base.Address `json:"address"` NetworkID string `json:"network_id"` Privatekey key.Privatekey `json:"privatekey"` Network LocalNetwork `json:"network,omitempty"` Storage Storage `json:"storage"` Nodes []RemoteNode `json:"nodes,omitempty"` Suffrage map[string]interface{} `json:"suffrage,omitempty"` ProposalProcessor map[string]interface{} `json:"proposal_processor,omitempty"` Policy Policy `json:"policy,omitempty"` GenesisOperations []operation.Operation `json:"genesis_operations,omitempty"` }
type BaseLocalNodePackerYAML ¶
type BaseLocalNodePackerYAML struct { Address base.Address NetworkID string `yaml:"network-id"` Privatekey key.Privatekey Network LocalNetwork `yaml:",omitempty"` Storage Storage Nodes []RemoteNode `yaml:"nodes,omitempty"` Suffrage map[string]interface{} `yaml:",omitempty"` ProposalProcessor map[string]interface{} `yaml:",omitempty"` Policy Policy `yaml:",omitempty"` GenesisOperations []operation.Operation `yaml:"genesis-operations,omitempty"` Extras map[string]interface{} `yaml:",inline,omitempty"` }
func NewBaseLocalNodePackerYAMLFromConfig ¶
func NewBaseLocalNodePackerYAMLFromConfig(conf LocalNode) BaseLocalNodePackerYAML
type BaseNodeNetwork ¶
type BaseNodeNetwork struct {
// contains filtered or unexported fields
}
func EmptyBaseNodeNetwork ¶
func EmptyBaseNodeNetwork() *BaseNodeNetwork
func (BaseNodeNetwork) ConnInfo ¶
func (no BaseNodeNetwork) ConnInfo() network.ConnInfo
func (*BaseNodeNetwork) SetConnInfo ¶
func (no *BaseNodeNetwork) SetConnInfo(c network.ConnInfo) error
type BasePolicy ¶
type BasePolicy struct {
// contains filtered or unexported fields
}
func (BasePolicy) IntervalBroadcastingACCEPTBallot ¶
func (no BasePolicy) IntervalBroadcastingACCEPTBallot() time.Duration
func (BasePolicy) IntervalBroadcastingINITBallot ¶
func (no BasePolicy) IntervalBroadcastingINITBallot() time.Duration
func (BasePolicy) IntervalBroadcastingProposal ¶
func (no BasePolicy) IntervalBroadcastingProposal() time.Duration
func (BasePolicy) MarshalJSON ¶
func (no BasePolicy) MarshalJSON() ([]byte, error)
func (BasePolicy) MarshalYAML ¶
func (no BasePolicy) MarshalYAML() (interface{}, error)
func (*BasePolicy) MaxOperationsInProposal ¶
func (no *BasePolicy) MaxOperationsInProposal() uint
func (*BasePolicy) MaxOperationsInSeal ¶
func (no *BasePolicy) MaxOperationsInSeal() uint
func (BasePolicy) NetworkConnectionTimeout ¶
func (no BasePolicy) NetworkConnectionTimeout() time.Duration
func (*BasePolicy) SetIntervalBroadcastingACCEPTBallot ¶
func (no *BasePolicy) SetIntervalBroadcastingACCEPTBallot(s string) error
func (*BasePolicy) SetIntervalBroadcastingINITBallot ¶
func (no *BasePolicy) SetIntervalBroadcastingINITBallot(s string) error
func (*BasePolicy) SetIntervalBroadcastingProposal ¶
func (no *BasePolicy) SetIntervalBroadcastingProposal(s string) error
func (*BasePolicy) SetMaxOperationsInProposal ¶
func (no *BasePolicy) SetMaxOperationsInProposal(m uint) error
func (*BasePolicy) SetMaxOperationsInSeal ¶
func (no *BasePolicy) SetMaxOperationsInSeal(m uint) error
func (*BasePolicy) SetNetworkConnectionTimeout ¶
func (no *BasePolicy) SetNetworkConnectionTimeout(s string) error
func (*BasePolicy) SetThresholdRatio ¶
func (no *BasePolicy) SetThresholdRatio(s float64) error
func (*BasePolicy) SetTimeoutWaitingProposal ¶
func (no *BasePolicy) SetTimeoutWaitingProposal(s string) error
func (*BasePolicy) SetTimespanValidBallot ¶
func (no *BasePolicy) SetTimespanValidBallot(s string) error
func (*BasePolicy) SetWaitBroadcastingACCEPTBallot ¶
func (no *BasePolicy) SetWaitBroadcastingACCEPTBallot(s string) error
func (BasePolicy) ThresholdRatio ¶
func (no BasePolicy) ThresholdRatio() base.ThresholdRatio
func (BasePolicy) TimeoutWaitingProposal ¶
func (no BasePolicy) TimeoutWaitingProposal() time.Duration
func (BasePolicy) TimespanValidBallot ¶
func (no BasePolicy) TimespanValidBallot() time.Duration
func (BasePolicy) WaitBroadcastingACCEPTBallot ¶
func (no BasePolicy) WaitBroadcastingACCEPTBallot() time.Duration
type BasePolicyPackerJSON ¶
type BasePolicyPackerJSON struct { ThresholdRatio base.ThresholdRatio `json:"threshold,omitempty"` MaxOperationsInSeal uint `json:"max_operations_in_seal"` MaxOperationsInProposal uint `json:"max_operations_in_proposal"` TimeoutWaitingProposal string `json:"timeout_waiting_proposal,omitempty"` IntervalBroadcastingINITBallot string `json:"interval_broadcasting_init_ballot,omitempty"` IntervalBroadcastingProposal string `json:"interval_broadcasting_proposal,omitempty"` WaitBroadcastingACCEPTBallot string `json:"wait_broadcasting_accept_ballot,omitempty"` IntervalBroadcastingACCEPTBallot string `json:"interval_broadcasting_accept_ballot,omitempty"` TimespanValidBallot string `json:"timespan_valid_ballot,omitempty"` NetworkConnectionTimeout string `json:"network_connection_timeout,omitempty"` }
type BasePolicyPackerYAML ¶
type BasePolicyPackerYAML struct { ThresholdRatio base.ThresholdRatio `yaml:"threshold,omitempty"` MaxOperationsInSeal uint `yaml:"max-operations-in-seal"` MaxOperationsInProposal uint `yaml:"max-operations-in-proposal"` TimeoutWaitingProposal time.Duration `yaml:"timeout-waiting-proposal,omitempty"` IntervalBroadcastingINITBallot time.Duration `yaml:"interval-broadcasting-init-ballot,omitempty"` IntervalBroadcastingProposal time.Duration `yaml:"interval-broadcasting-proposal,omitempty"` WaitBroadcastingACCEPTBallot time.Duration `yaml:"wait-broadcasting-accept-ballot,omitempty"` IntervalBroadcastingACCEPTBallot time.Duration `yaml:"interval-broadcasting-accept-ballot,omitempty"` TimespanValidBallot time.Duration `yaml:"timespan-valid-ballot,omitempty"` NetworkConnectionTimeout time.Duration `yaml:"network-connection-timeout,omitempty"` }
type BaseRateLimit ¶
type BaseRateLimit struct {
// contains filtered or unexported fields
}
func NewBaseRateLimit ¶
func NewBaseRateLimit(rules []RateLimitTargetRule) *BaseRateLimit
func (BaseRateLimit) Cache ¶
func (no BaseRateLimit) Cache() *url.URL
func (BaseRateLimit) MarshalJSON ¶
func (no BaseRateLimit) MarshalJSON() ([]byte, error)
func (BaseRateLimit) MarshalYAML ¶
func (no BaseRateLimit) MarshalYAML() (interface{}, error)
func (*BaseRateLimit) Preset ¶
func (no *BaseRateLimit) Preset() map[string]RateLimitRules
func (*BaseRateLimit) Rules ¶
func (no *BaseRateLimit) Rules() []RateLimitTargetRule
func (*BaseRateLimit) SetCache ¶
func (no *BaseRateLimit) SetCache(s string) error
func (*BaseRateLimit) SetPreset ¶
func (no *BaseRateLimit) SetPreset(preset map[string]RateLimitRules) error
func (*BaseRateLimit) SetRules ¶
func (no *BaseRateLimit) SetRules(rules []RateLimitTargetRule) error
type BaseRateLimitRules ¶
type BaseRateLimitRules struct {
// contains filtered or unexported fields
}
func NewBaseRateLimitRules ¶
func NewBaseRateLimitRules(rules map[string]limiter.Rate) *BaseRateLimitRules
func (BaseRateLimitRules) MarshalJSON ¶
func (no BaseRateLimitRules) MarshalJSON() ([]byte, error)
func (BaseRateLimitRules) MarshalYAML ¶
func (no BaseRateLimitRules) MarshalYAML() (interface{}, error)
func (*BaseRateLimitRules) Rules ¶
func (no *BaseRateLimitRules) Rules() map[string]limiter.Rate
func (*BaseRateLimitRules) SetRules ¶
func (no *BaseRateLimitRules) SetRules(rules map[string]limiter.Rate) error
type BaseRateLimitTargetRule ¶
type BaseRateLimitTargetRule struct { *BaseRateLimitRules // contains filtered or unexported fields }
func NewBaseRateLimitTargetRule ¶
func NewBaseRateLimitTargetRule(target, preset string) *BaseRateLimitTargetRule
func (*BaseRateLimitTargetRule) IPNet ¶
func (no *BaseRateLimitTargetRule) IPNet() *net.IPNet
func (BaseRateLimitTargetRule) MarshalJSON ¶
func (no BaseRateLimitTargetRule) MarshalJSON() ([]byte, error)
func (BaseRateLimitTargetRule) MarshalYAML ¶
func (no BaseRateLimitTargetRule) MarshalYAML() (interface{}, error)
func (*BaseRateLimitTargetRule) Preset ¶
func (no *BaseRateLimitTargetRule) Preset() string
func (*BaseRateLimitTargetRule) SetIPNet ¶
func (no *BaseRateLimitTargetRule) SetIPNet(s string) error
func (*BaseRateLimitTargetRule) Target ¶
func (no *BaseRateLimitTargetRule) Target() string
type BaseRemoteNode ¶
type BaseRemoteNode struct {
// contains filtered or unexported fields
}
func NewBaseRemoteNode ¶
func NewBaseRemoteNode(enc encoder.Encoder) *BaseRemoteNode
func (BaseRemoteNode) Address ¶
func (no BaseRemoteNode) Address() base.Address
func (BaseRemoteNode) ConnInfo ¶
func (no BaseRemoteNode) ConnInfo() network.ConnInfo
func (BaseRemoteNode) MarshalJSON ¶
func (no BaseRemoteNode) MarshalJSON() ([]byte, error)
func (BaseRemoteNode) Publickey ¶
func (no BaseRemoteNode) Publickey() key.Publickey
func (*BaseRemoteNode) SetAddress ¶
func (no *BaseRemoteNode) SetAddress(s string) error
func (*BaseRemoteNode) SetConnInfo ¶
func (no *BaseRemoteNode) SetConnInfo(s string, insecure bool) error
func (*BaseRemoteNode) SetPublickey ¶
func (no *BaseRemoteNode) SetPublickey(s string) error
type BaseStorage ¶
type BaseStorage struct {
// contains filtered or unexported fields
}
func EmptyBaseStorage ¶
func EmptyBaseStorage() *BaseStorage
func (BaseStorage) Blockdata ¶
func (no BaseStorage) Blockdata() Blockdata
func (BaseStorage) Database ¶
func (no BaseStorage) Database() Database
func (BaseStorage) MarshalJSON ¶
func (no BaseStorage) MarshalJSON() ([]byte, error)
func (BaseStorage) MarshalYAML ¶
func (no BaseStorage) MarshalYAML() (interface{}, error)
func (*BaseStorage) SetBlockdata ¶
func (no *BaseStorage) SetBlockdata(bs Blockdata) error
func (*BaseStorage) SetDatabase ¶
func (no *BaseStorage) SetDatabase(database Database) error
type BaseStoragePackerJSON ¶
type BaseStoragePackerJSON struct { Database DatabasePackerJSON `json:"database"` Blockdata BlockdataPackerJSON `json:"blockdata"` }
type BaseStoragePackerYAML ¶
type BaseStoragePackerYAML struct { Database DatabasePackerYAML `yaml:"database"` Blockdata BlockdataPackerYAML `yaml:"blockdata"` }
type BlockdataPackerJSON ¶
type BlockdataPackerJSON struct {
Path string `json:"path"`
}
type BlockdataPackerYAML ¶
type BlockdataPackerYAML struct {
Path string
}
type DatabasePackerJSON ¶
type DatabasePackerYAML ¶
type DefaultLocalConfig ¶
type DefaultLocalConfig struct {
// contains filtered or unexported fields
}
func EmptyDefaultLocalConfig ¶
func EmptyDefaultLocalConfig() *DefaultLocalConfig
func (DefaultLocalConfig) MarshalJSON ¶
func (no DefaultLocalConfig) MarshalJSON() ([]byte, error)
func (DefaultLocalConfig) MarshalYAML ¶
func (no DefaultLocalConfig) MarshalYAML() (interface{}, error)
func (*DefaultLocalConfig) SetSyncInterval ¶
func (no *DefaultLocalConfig) SetSyncInterval(s string) error
func (*DefaultLocalConfig) SetTimeServer ¶
func (no *DefaultLocalConfig) SetTimeServer(s string) error
func (*DefaultLocalConfig) SyncInterval ¶
func (no *DefaultLocalConfig) SyncInterval() time.Duration
func (*DefaultLocalConfig) TimeServer ¶
func (no *DefaultLocalConfig) TimeServer() string
type DefaultProposalProcessor ¶
type DefaultProposalProcessor struct{}
func (DefaultProposalProcessor) ProposalProcessorType ¶
func (DefaultProposalProcessor) ProposalProcessorType() string
type EmptySuffrage ¶
type EmptySuffrage struct{}
func (EmptySuffrage) IsValid ¶
func (EmptySuffrage) IsValid([]byte) error
func (EmptySuffrage) Nodes ¶
func (EmptySuffrage) Nodes() []base.Address
func (EmptySuffrage) NumberOfActing ¶
func (EmptySuffrage) NumberOfActing() uint
func (EmptySuffrage) SuffrageType ¶
func (EmptySuffrage) SuffrageType() string
type ErrorPoint ¶
type ErrorPoint struct { Type ErrorType `json:"type"` Height base.Height `json:"height"` Round base.Round `json:"round"` }
func (*ErrorPoint) UnmarshalYAML ¶
func (ep *ErrorPoint) UnmarshalYAML(decode func(v interface{}) error) error
type ErrorPointYAML ¶
type ErrorProposalProcessor ¶
type ErrorProposalProcessor struct { WhenPreparePoints []ErrorPoint WhenSavePoints []ErrorPoint }
func (ErrorProposalProcessor) ProposalProcessorType ¶
func (ErrorProposalProcessor) ProposalProcessorType() string
type FixedSuffrage ¶
type FixedSuffrage struct { Proposer base.Address CacheSize int // contains filtered or unexported fields }
func NewFixedSuffrage ¶
func (FixedSuffrage) IsValid ¶
func (fd FixedSuffrage) IsValid([]byte) error
func (FixedSuffrage) Nodes ¶
func (fd FixedSuffrage) Nodes() []base.Address
func (FixedSuffrage) NumberOfActing ¶
func (fd FixedSuffrage) NumberOfActing() uint
func (FixedSuffrage) SuffrageType ¶
func (FixedSuffrage) SuffrageType() string
type LocalConfig ¶
type LocalNetwork ¶
type LocalNetwork interface { ConnInfo() network.ConnInfo SetConnInfo(network.ConnInfo) error Bind() *url.URL SetBind(string) error Certs() []tls.Certificate SetCerts([]tls.Certificate) error Cache() *url.URL SetCache(string) error SealCache() *url.URL SetSealCache(string) error RateLimit() RateLimit SetRateLimit(RateLimit) error }
type LocalNode ¶
type LocalNode interface { Source() map[string]interface{} Node NetworkID() base.NetworkID SetNetworkID(string) error Privatekey() key.Privatekey SetPrivatekey(string) error Network() LocalNetwork SetNetwork(LocalNetwork) error Storage() Storage SetStorage(Storage) error Nodes() []RemoteNode SetNodes([]RemoteNode) error Suffrage() Suffrage SetSuffrage(Suffrage) error ProposalProcessor() ProposalProcessor SetProposalProcessor(ProposalProcessor) error Policy() Policy SetPolicy(Policy) error GenesisOperations() []operation.Operation SetGenesisOperations([]operation.Operation) error LocalConfig() LocalConfig SetLocalConfig(LocalConfig) error }
type Policy ¶
type Policy interface { ThresholdRatio() base.ThresholdRatio SetThresholdRatio(float64) error MaxOperationsInSeal() uint SetMaxOperationsInSeal(uint) error MaxOperationsInProposal() uint SetMaxOperationsInProposal(uint) error TimeoutWaitingProposal() time.Duration SetTimeoutWaitingProposal(string) error IntervalBroadcastingINITBallot() time.Duration SetIntervalBroadcastingINITBallot(string) error IntervalBroadcastingProposal() time.Duration SetIntervalBroadcastingProposal(string) error WaitBroadcastingACCEPTBallot() time.Duration SetWaitBroadcastingACCEPTBallot(string) error IntervalBroadcastingACCEPTBallot() time.Duration SetIntervalBroadcastingACCEPTBallot(string) error TimespanValidBallot() time.Duration SetTimespanValidBallot(string) error NetworkConnectionTimeout() time.Duration SetNetworkConnectionTimeout(string) error }
type ProposalProcessor ¶
type ProposalProcessor interface {
ProposalProcessorType() string
}
type RateLimit ¶
type RateLimit interface { Preset() map[string]RateLimitRules SetPreset(map[string]RateLimitRules) error Rules() []RateLimitTargetRule SetRules([]RateLimitTargetRule) error Cache() *url.URL SetCache(string) error }
type RateLimitChecker ¶
func NewRateLimitChecker ¶
func NewRateLimitChecker( ctx context.Context, conf RateLimit, basePreset map[string]RateLimitRules, ) *RateLimitChecker
func (*RateLimitChecker) Check ¶
func (cc *RateLimitChecker) Check() (bool, error)
func (*RateLimitChecker) Config ¶
func (cc *RateLimitChecker) Config() RateLimit
func (*RateLimitChecker) Context ¶
func (cc *RateLimitChecker) Context() context.Context
func (*RateLimitChecker) Initialize ¶
func (cc *RateLimitChecker) Initialize() (bool, error)
type RateLimitRules ¶
type RateLimitTargetRule ¶
type RemoteNode ¶
type RoundrobinSuffrage ¶
type RoundrobinSuffrage struct { CacheSize int // contains filtered or unexported fields }
func NewRoundrobinSuffrage ¶
func NewRoundrobinSuffrage(nodes []base.Address, numberOfActing uint) RoundrobinSuffrage
func (RoundrobinSuffrage) IsValid ¶
func (fd RoundrobinSuffrage) IsValid([]byte) error
func (RoundrobinSuffrage) Nodes ¶
func (fd RoundrobinSuffrage) Nodes() []base.Address
func (RoundrobinSuffrage) NumberOfActing ¶
func (fd RoundrobinSuffrage) NumberOfActing() uint
func (RoundrobinSuffrage) SuffrageType ¶
func (RoundrobinSuffrage) SuffrageType() string
Source Files
¶
- checker.go
- context.go
- doc.go
- local_config.go
- local_config_json.go
- local_config_yaml.go
- local_node.go
- local_node_json.go
- local_node_yaml.go
- network.go
- network_json.go
- network_yaml.go
- node.go
- node_json.go
- policy.go
- policy_json.go
- policy_yaml.go
- proposal_processor.go
- proposal_processor_yaml.go
- ratelimit.go
- ratelimit_checker.go
- ratelimit_json.go
- ratelimit_yaml.go
- storage.go
- storage_json.go
- storage_yaml.go
- suffrage.go
- util.go
- validate.go
Click to show internal directories.
Click to hide internal directories.