Documentation ¶
Index ¶
- func Error(msg string) error
- func New(name string, cfg json.RawMessage) (weaver.Sharder, error)
- func NewHashRingStrategy(data json.RawMessage) (weaver.Sharder, error)
- func NewLookupStrategy(data json.RawMessage) (weaver.Sharder, error)
- func NewModuloStrategy(data json.RawMessage) (weaver.Sharder, error)
- func NewNoStrategy(data json.RawMessage) (weaver.Sharder, error)
- func NewPrefixLookupStrategy(data json.RawMessage) (weaver.Sharder, error)
- func NewS2Strategy(data json.RawMessage) (weaver.Sharder, error)
- type BackendDefinition
- type CustomError
- type HashRingStrategy
- type HashRingStrategyConfig
- type LookupStrategy
- type ModuloStrategy
- type NoStrategy
- type NoStrategyConfig
- type PrefixLookupStrategy
- type S2Strategy
- type S2StrategyConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHashRingStrategy ¶
func NewHashRingStrategy(data json.RawMessage) (weaver.Sharder, error)
func NewLookupStrategy ¶
func NewLookupStrategy(data json.RawMessage) (weaver.Sharder, error)
func NewModuloStrategy ¶
func NewModuloStrategy(data json.RawMessage) (weaver.Sharder, error)
func NewNoStrategy ¶
func NewNoStrategy(data json.RawMessage) (weaver.Sharder, error)
func NewPrefixLookupStrategy ¶
func NewPrefixLookupStrategy(data json.RawMessage) (weaver.Sharder, error)
func NewS2Strategy ¶
func NewS2Strategy(data json.RawMessage) (weaver.Sharder, error)
Types ¶
type BackendDefinition ¶
type BackendDefinition struct { BackendName string `json:"backend_name"` BackendURL string `json:"backend"` Timeout *float64 `json:"timeout,omitempty"` }
func (BackendDefinition) Validate ¶
func (bd BackendDefinition) Validate() error
type CustomError ¶
type CustomError struct {
ExitMessage string
}
func (*CustomError) Error ¶
func (e *CustomError) Error() string
type HashRingStrategy ¶
type HashRingStrategy struct {
// contains filtered or unexported fields
}
type HashRingStrategyConfig ¶
type HashRingStrategyConfig struct { TotalVirtualBackends *int `json:"totalVirtualBackends"` Backends map[string]BackendDefinition `json:"backends"` }
func (HashRingStrategyConfig) Validate ¶
func (hrCfg HashRingStrategyConfig) Validate() error
type LookupStrategy ¶
type LookupStrategy struct {
// contains filtered or unexported fields
}
type ModuloStrategy ¶
type ModuloStrategy struct {
// contains filtered or unexported fields
}
type NoStrategy ¶
type NoStrategy struct {
// contains filtered or unexported fields
}
type NoStrategyConfig ¶
type NoStrategyConfig struct {
BackendDefinition `json:",inline"`
}
type PrefixLookupStrategy ¶
type PrefixLookupStrategy struct {
// contains filtered or unexported fields
}
type S2Strategy ¶
type S2Strategy struct {
// contains filtered or unexported fields
}
type S2StrategyConfig ¶
type S2StrategyConfig struct { ShardKeySeparator string `json:"shard_key_separator"` ShardKeyPosition *int `json:"shard_key_position,omitempty"` Backends map[string]BackendDefinition `json:"backends"` }
func (S2StrategyConfig) Validate ¶
func (s2cfg S2StrategyConfig) Validate() error
Click to show internal directories.
Click to hide internal directories.