Documentation ¶
Index ¶
- Constants
- func GetLeaderElectionConfigKey(name string) string
- func GetLeaderElectionConfigKeyType(name string) string
- func NewDdbLockProvider(ctx context.Context, config cfg.Config, logger log.Logger, ...) (conc.DistributedLockProvider, error)
- func NewDdbLockProviderWithInterfaces(logger log.Logger, repo ddb.Repository, backOff backoff.BackOff, ...) conc.DistributedLockProvider
- type DdbLeaderElection
- type DdbLeaderElectionItem
- type DdbLeaderElectionSettings
- type DdbLockItem
- type LeaderElection
- func NewDdbLeaderElection(ctx context.Context, config cfg.Config, logger log.Logger, name string) (LeaderElection, error)
- func NewDdbLeaderElectionWithSettings(ctx context.Context, config cfg.Config, logger log.Logger, ...) (LeaderElection, error)
- func NewLeaderElection(ctx context.Context, config cfg.Config, logger log.Logger, name string) (LeaderElection, error)
- func NewStaticLeaderElection(_ context.Context, config cfg.Config, _ log.Logger, name string) (LeaderElection, error)
- type LeaderElectionFactory
- type StaticLeaderElection
- type StaticLeaderElectionSettings
- type TableNamingSettings
Constants ¶
View Source
const ( LeaderElectionTypeDdb = "ddb" LeaderElectionTypeStatic = "static" )
Variables ¶
This section is empty.
Functions ¶
func NewDdbLockProvider ¶
func NewDdbLockProviderWithInterfaces ¶
func NewDdbLockProviderWithInterfaces( logger log.Logger, repo ddb.Repository, backOff backoff.BackOff, clock clock.Clock, uuidSource uuid.Uuid, settings conc.DistributedLockSettings, ) conc.DistributedLockProvider
Types ¶
type DdbLeaderElection ¶
type DdbLeaderElection struct {
// contains filtered or unexported fields
}
func NewDdbLeaderElectionWithInterfaces ¶
func NewDdbLeaderElectionWithInterfaces(logger log.Logger, clock clock.Clock, repository ddb.Repository, settings *DdbLeaderElectionSettings) (*DdbLeaderElection, error)
type DdbLeaderElectionItem ¶
type DdbLeaderElectionSettings ¶
type DdbLeaderElectionSettings struct { Naming TableNamingSettings `cfg:"naming"` ClientName string `cfg:"client_name" default:"default"` GroupId string `cfg:"group_id" default:"{app_name}"` LeaseDuration time.Duration `cfg:"lease_duration" default:"1m"` }
type DdbLockItem ¶
type LeaderElection ¶
type LeaderElection interface { IsLeader(ctx context.Context, memberId string) (bool, error) Resign(ctx context.Context, memberId string) error }
func NewDdbLeaderElection ¶
func NewDdbLeaderElectionWithSettings ¶
func NewDdbLeaderElectionWithSettings(ctx context.Context, config cfg.Config, logger log.Logger, settings *DdbLeaderElectionSettings) (LeaderElection, error)
func NewLeaderElection ¶
type LeaderElectionFactory ¶
type StaticLeaderElection ¶
type StaticLeaderElection struct {
// contains filtered or unexported fields
}
func NewStaticLeaderElectionWithSettings ¶
func NewStaticLeaderElectionWithSettings(settings *StaticLeaderElectionSettings) (*StaticLeaderElection, error)
type StaticLeaderElectionSettings ¶
type StaticLeaderElectionSettings struct {
Result bool `cfg:"result"`
}
type TableNamingSettings ¶
type TableNamingSettings struct {
Pattern string `cfg:"pattern,nodecode" default:"{project}-{env}-{family}-leader-elections"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.