std_decorators

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShardingByServiceIdLabel = "byServiceId"

	ServiceNamePatternPrefix = "services/{service}"
)
View Source
const (
	ShardingByNameLabel = "byName"
)

Variables

This section is empty.

Functions

func NewShardingByName

func NewShardingByName(rings ...*sharding.RingConfig) *sharding.Decorator

NewShardingByName gives decorator which assigns shards based solely resource name. All ring configs must contain one FieldPath object with Label = "byName".

func NewShardingByNameAlg

func NewShardingByNameAlg() sharding.Algorithm

func NewShardingByServiceId

func NewShardingByServiceId(rings ...*sharding.RingConfig) *sharding.Decorator

NewShardingByServiceId gives decorator which assigns shards based solely on service ID. All ring configs must contain one FieldPath object with Label = "byServiceId".

Types

type ServiceIdExtractorShardingOverride

type ServiceIdExtractorShardingOverride interface {
	resource.Resource
	GetServiceIdForSharding() string
}

Jump to

Keyboard shortcuts

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