Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { // Find returns the State, if there is no State it'll return an empty State Find(ctx context.Context) (*State, error) // Update updates the State Update(ctx context.Context, s *State) error // DeleteAll deletes all the state data DeleteAll(ctx context.Context) error }
Repository are the actions that can be done to modify the volume State
type State ¶
type State struct { // The Mountpoint of the volume, so we can make // sure it's that if it's also used by // another volume we do not repeat Stats Mountpoint string SystemTotalSize int SystemUsedSize int // TotalSize is the total size of the volume // if not specified then this value will be -1 VolumeTotalSize int // UsedSize is the total used size of the volume objects VolumeUsedSize int // UpdatedAt is useful to be able to know on restart // how long has it been since the last check, it's like // a heartbeat UpdatedAt time.Time }
State is the current state in which the volume is
func (*State) CanStore ¶
CanStore will check if the b bytes fit into the defined sizes to prevent over sizing
func (*State) IsInDowntimeRange ¶ added in v0.3.0
IsInDowntimeRange will check if the s.UpdatedAt plus the duration is older than the current date, meaning it's not on range
Click to show internal directories.
Click to hide internal directories.