Help us shape the future of Go! Take the 2026 Go Developer Survey

precreator

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultCheckInterval is the shard precreation check time if none is specified.
	DefaultCheckInterval = 10 * time.Minute

	// DefaultAdvancePeriod is the default period ahead of the endtime of a shard group
	// that its successor group is created.
	DefaultAdvancePeriod = 30 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled       bool          `toml:"enabled"`
	CheckInterval toml.Duration `toml:"check-interval"`
	AdvancePeriod toml.Duration `toml:"advance-period"`
}

Config represents the configuration for shard precreation.

func NewConfig

func NewConfig() Config

NewConfig returns a new Config with defaults.

type Service

type Service struct {
	Logger *log.Logger

	MetaStore interface {
		IsLeader() bool
		PrecreateShardGroups(cutoff time.Time) error
	}
	// contains filtered or unexported fields
}

func NewService

func NewService(c Config) (*Service, error)

NewService returns an instance of the precreation service.

func (*Service) Close

func (s *Service) Close() error

Close stops the precreation service.

func (*Service) Open

func (s *Service) Open() error

Open starts the precreation service.

func (*Service) SetLogger

func (s *Service) SetLogger(l *log.Logger)

SetLogger sets the internal logger to the logger passed in.

Jump to

Keyboard shortcuts

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