package resources

import "time"

// Resourcer is the interface for resource, resource is the resource to be scaled up or down.
// For example, diag-engine is a resource, and the number of diag-engine is the number of diag-engine pods.
type Resourcer interface {
	// Offline deletes resource which is marked offline by ScaleDown.
	Offline() error
	// ScaleUp scales up resource, count is the number of resources to be scaled up.
	ScaleUp(count int) error
	// ScaleDown scales down resource, count is the number of resources to be scaled down.
	// ScaleDown is used to mark resource offline, and Offline is used to delete resource.
	ScaleDown(count int) error
	// GetScaleCount gets the number of resources to be scaled up or down.
	// If the number is positive, it means to scale up, otherwise it means to scale down.
	GetScaleCount() (count int, err error)
	// Interval gets the interval of sync resource.
	Interval() time.Duration
	// Name gets the name of resource.
	Name() string
	// IsExist checks whether the resource exists.
	IsExist() bool
}
