Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct {
Server struct {
Port int `yaml:"port"`
MaxCommitRetryTimeout int64 `yaml:"maxCommitRetryTimeout"`
MaxRollbackRetryTimeout int64 `yaml:"maxRollbackRetryTimeout"`
RollbackRetryTimeoutUnlockEnable bool `yaml:"rollbackRetryTimeoutUnlockEnable"`
AsyncCommittingRetryPeriod time.Duration `yaml:"asyncCommittingRetryPeriod"`
CommittingRetryPeriod time.Duration `yaml:"committingRetryPeriod"`
RollingBackRetryPeriod time.Duration `yaml:"rollingBackRetryPeriod"`
TimeoutRetryPeriod time.Duration `yaml:"timeoutRetryPeriod"`
StreamMessageTimeout time.Duration `yaml:"streamMessageTimeout"`
} `yaml:"server"`
EnforcementPolicy struct {
MinTime time.Duration `yaml:"minTime"`
PermitWithoutStream bool `yaml:"permitWithoutStream"`
} `yaml:"enforcementPolicy"`
ServerParameters struct {
MaxConnectionIdle time.Duration `yaml:"maxConnectionIdle"`
MaxConnectionAge time.Duration `yaml:"maxConnectionAge"`
MaxConnectionAgeGrace time.Duration `yaml:"maxConnectionAgeGrace"`
Time time.Duration `yaml:"time"`
Timeout time.Duration `yaml:"timeout"`
} `yaml:"serverParameters"`
// Storage is the configuration for the storage driver
Storage Storage `yaml:"storage"`
Log struct {
LogPath string `yaml:"logPath"`
LogLevel log.Level `yaml:"logLevel"`
} `yaml:"log"`
}
Configuration is a versioned registry configuration, intended to be provided by a yaml file, and optionally modified by environment variables.
Note that yaml field names should never include _ characters, since this is the separator used in environment variable names.
func Parse ¶
func Parse(rd io.Reader) (*Configuration, error)
Parse parses an input configuration yaml document into a Configuration struct
Environment variables may be used to override configuration parameters other than version, following the scheme below: Configuration.Abc may be replaced by the value of SEATA_ABC, Configuration.Abc.Xyz may be replaced by the value of SEATA_ABC_XYZ, and so forth
func (*Configuration) GetEnforcementPolicy ¶
func (configuration *Configuration) GetEnforcementPolicy() keepalive.EnforcementPolicy
func (*Configuration) GetServerParameters ¶
func (configuration *Configuration) GetServerParameters() keepalive.ServerParameters
type Parameters ¶
type Parameters map[string]interface{}
Parameters defines a key-value parameters mapping
type Storage ¶
type Storage map[string]Parameters
Storage defines the configuration for registry object storage
func (Storage) MarshalYAML ¶
MarshalYAML implements the yaml.Marshaler interface
func (Storage) Parameters ¶
func (storage Storage) Parameters() Parameters
Parameters returns the Parameters map for a Storage configuration
func (*Storage) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface Unmarshals a single item map into a Storage or a string into a Storage type with no parameters