scheduler

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClusterAdapter

func NewClusterAdapter(uc *usecase.ClusterUseCase) *clusterUseCaseAdapter

NewClusterAdapter wires the production ClusterUseCase for scheduler use.

Types

type IDLister

type IDLister interface {
	ListAllIDs(ctx context.Context) ([]string, error)
}

IDLister is the scheduler's read-side dependency. Adapter above is the production wiring; tests pass an in-memory stub.

type Options

type Options struct {
	Interval    time.Duration
	IterTimeout time.Duration
	Logger      *slog.Logger
	Clock       func() time.Time
}

Options configures the scheduler; all optional.

type RefreshDiscoveryScheduler

type RefreshDiscoveryScheduler struct {
	// contains filtered or unexported fields
}

RefreshDiscoveryScheduler runs ClusterUseCase.RefreshDiscovery on every registered cluster at a fixed interval. Phase 7 of F8 follow-up: catches node_architectures drift that would otherwise accumulate between manual Refresh Discovery clicks in the admin UI.

func NewRefreshDiscoveryScheduler

func NewRefreshDiscoveryScheduler(lister IDLister, runner RefreshRunner, opts Options) *RefreshDiscoveryScheduler

NewRefreshDiscoveryScheduler constructs a scheduler. interval defaults to 24h; iterTimeout defaults to 5m; clock defaults to time.Now.

func (*RefreshDiscoveryScheduler) Start

Start blocks until ctx is canceled, running an iteration every interval. The first iteration runs immediately on Start so fresh deployments don't wait a full interval for initial discovery.

type RefreshRunner

type RefreshRunner interface {
	RefreshDiscoveryByID(ctx context.Context, id string) error
}

RefreshRunner is the subset of ClusterUseCase the scheduler calls per cluster. Mirrors `ClusterUseCase.RefreshDiscovery(ctx, id)`.

type RotationRestarter

type RotationRestarter interface {
	RestartForProvider(ctx context.Context, clusterID, namespace, provider string) error
}

RotationRestarter 는 회전 성공 후 소비자 재시작을 담당한다.

type TokenRotationScheduler

type TokenRotationScheduler struct {
	// contains filtered or unexported fields
}

func NewTokenRotationScheduler

func NewTokenRotationScheduler(pool *pgxpool.Pool, secret *secrets.Router, interval, iterTimeout time.Duration, logger *slog.Logger, reissuer rotation.Reissuer) *TokenRotationScheduler

func (*TokenRotationScheduler) Start

func (s *TokenRotationScheduler) Start(ctx context.Context)

func (*TokenRotationScheduler) WithRestarter

WithRestarter 는 회전 후 반영 단계를 활성화한다.

Jump to

Keyboard shortcuts

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