cmd

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Credentials file containing a Whoop authentication token. Can also be set through ENV variable or configuration file.
	CredentialsFile string

	// ConfigurationData is the configuration data
	Configuration internal.ConfigurationData
	// UserAgent is the value to use for the User-Agent header
	UserAgent string
	// Debug is a flag to enable debug output
	VerbosityLevel string
	// VersionString is the version of the CLI
	VersionString string = "0.0.0"
	// StaticAssets is the embedded static assets
	GlobalStaticAssets embed.FS
)
View Source
var VersionCmd = &cobra.Command{
	Use:   "version",
	Short: "Print the current version number of mywhoop",
	Long:  `Prints the current version number of mywhoop`,
	RunE: func(cmd *cobra.Command, args []string) error {
		version := fmt.Sprintf("mywhoop v%s", VersionString)
		slog.Info(version)
		return nil
	},
}

Functions

func Execute

func Execute(ctx context.Context, args []string, stdout, stderr *os.File, staticAssets embed.FS) error

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

func InitLogger

func InitLogger(cfg *internal.ConfigurationData) error

InitLogger initializes the logger

Types

type PageData added in v0.0.4

type PageData struct {
	// AuthURL is the URL to authenticate with the Whoop API
	AuthURL string
	// CredentialsFilePath is the path to the file where the access token is stored
	CredentialsFilePath string
	// Error is the error message
	Error string
	// StatusCode is the HTTP status code
	StatusCode int
	// Token is the Oauth access token
	Token string
}

PageData is the data structure for the HTML template

Jump to

Keyboard shortcuts

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