cli

package
v0.0.0-...-3ecb42e Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Config            *config.Config
	SessionRepository repositories.SessionRepository
	ClientRepository  repositories.ClientRepository
	Puncher           *puncher.Puncher
	Source            *sync.SyncSource
)

common instances

View Source
var (
	NoAvailableDataError = errors.New("No available data")
)

Functions

func Execute

func Execute(cfg *config.Config) error

func ExtractParsedTimeFromArgs

func ExtractParsedTimeFromArgs(args []string, clientName string) (time.Time, time.Time, error)

func ExtractTime

func ExtractTime(input string, client *models.Client) (time.Time, time.Time, error)

func FilterSessionsByClient

func FilterSessionsByClient(sessions *[]models.Session, clientName string) *[]models.Session

func GetClientIfExists

func GetClientIfExists(name string) error

func GetRelativeSessionsFromArgs

func GetRelativeSessionsFromArgs(args []string, clientName string) []models.Session

func GetSessionByID

func GetSessionByID(id string) (*models.Session, error)

func GetSessionsWithTimeframe

func GetSessionsWithTimeframe(timeframe ReportTimeframe) []models.Session

func SortSessions

func SortSessions(slice *[]models.Session, descending bool)

func Sync

func Sync(cmd *cobra.Command) error

Types

type ReportTimeframe

type ReportTimeframe string
const (
	REPORT_TIMEFRAME_DAY   ReportTimeframe = "day"
	REPORT_TIMEFRAME_WEEK  ReportTimeframe = "week"
	REPORT_TIMEFRAME_MONTH ReportTimeframe = "month"
	REPORT_TIMEFRAME_YEAR  ReportTimeframe = "year"
)

func ExtractTimeframeFromFlags

func ExtractTimeframeFromFlags() (*ReportTimeframe, error)

Jump to

Keyboard shortcuts

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