system

package
v0.0.0-...-bbd0b33 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cfg

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

Cfg implements Config interface

func (Cfg) GetCooldownTime

func (c Cfg) GetCooldownTime() time.Duration

GetCooldownTime returns cooldown duration

func (Cfg) GetMinUsageTime

func (c Cfg) GetMinUsageTime() time.Duration

GetMinUsageTime returns minimum time duration

func (Cfg) LoopCheck

func (c Cfg) LoopCheck() bool

LoopCheck replicates a custom loop condition check

func (Cfg) LoopNext

func (c Cfg) LoopNext()

LoopNext is called before each loop

type Config

type Config interface {
	GetCooldownTime() time.Duration
	GetMinUsageTime() time.Duration
	LoopCheck() bool
	LoopNext()
}

Config represents various configurations

func GetConfig

func GetConfig(cooldown, minUsage time.Duration) Config

GetConfig returns a config struct with the given properties

type Current

type Current struct{}

Current represents the current operating system

func (Current) GetApplicationName

func (c Current) GetApplicationName() (appName string)

GetApplicationName returns the name of current forground application

func (Current) Log

func (c Current) Log(msg string)

Log is used for system specific logging

func (Current) Now

func (c Current) Now() time.Time

Now returns current time

type OS

type OS interface {
	GetApplicationName() string
	Now() time.Time
	Log(string)
}

OS represents an operating system

Jump to

Keyboard shortcuts

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