cmd

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DBPath string
)

Functions

func ConvertTimeToCarbon

func ConvertTimeToCarbon(beginDate, endDate string) (carbon.Carbon, carbon.Carbon, error)

ConvertTimeToCarbon converts the begin and end date to carbon.Carbon

func CreateDBIfNotExists

func CreateDBIfNotExists(dbPath string) (*sqlite.Storage, error)

CreateDBIfNotExists creates the database if it does not exist

func DefaultDBPath

func DefaultDBPath() (string, error)

DefaultDBPath returns the default path of the database

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately.

func InitAWSConfig

func InitAWSConfig(ctx context.Context, profile string) (cfg aws.Config, err error)

InitAWSConfig initializes the AWS SDK configuration If the ssoProfile is empty, it will use the default profile

func InitDB

func InitDB()

InitDB initializes the database It will create the database if it does not exist It will initialize some global variables In case of error, it will exit the program

func NewLogger

func NewLogger(debugLevel string) *logrus.Logger

NewLogger creates a new logger The debugLevel is the variable to set the log level It can be "info", "warn", "error" or "debug" If the variable is not set, the default log level is "info" Be careful, the log level is case sensitive and by default, every logs are **discarded**, set the output to os.Stdout to see the logs Example: l:=NewLogger(); l.SetOutput(os.Stdout)

Types

This section is empty.

Jump to

Keyboard shortcuts

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