goc

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 13 Imported by: 0

README

Google Calendar CLI

Simple CLI for tracking work hours into Google calendar.

Setup (Linux)

  • Download the latest goc file from the release page or clone this repo and build it yourself
  • Make sure goc is executable, if not run: chmod +x goc
  • Move the goc file into /usr/local/bin
  • Setup and download the Google credentials.json file
    • Create a new project
    • Setup OAuth consent screen (only need to fill out the required fields)
    • Click on credentials and create credentials then select OAuth client ID
    • Set application type to Desktop app and follow the steps
    • Choose download JSON after creating the credential
    • Rename the file you downloaded to credentials.json
    • Move this file into $HOME/.goc_cli
  • Reset(close/reopen) terminal window for changes to take effect
  • Run goc to see help and usage, and goc help COMMAND to see command info

Setup (Other)

If you want to use this on Max and Windows, you need to make some changes. This includes, but may not be limited to the following:

  • You need to build the executable on your own, the one in the release page will not work
    • Need go installed on your system
    • Run go build cmd/goc.go to build the executable
  • The $HOME environment variable is used, if your system don't support this, you can hardcode a path instead of $HOME

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FILE_NAME = "data.json"
View Source
var SHARED_PATH = os.Getenv("HOME") + "/.goc_cli/"
View Source
var TIME_FORMAT = "2006-01-02 15:04 MST"

magic reference: Mon Jan 2 15:04:05 MST 2006

Functions

func AddTaskAlias added in v1.2.0

func AddTaskAlias(c *cli.Context)

func DelTaskAlias added in v1.2.0

func DelTaskAlias(c *cli.Context)

func EditCurrentTask added in v1.1.0

func EditCurrentTask(c *cli.Context)

func EndTask

func EndTask(c *cli.Context)

func GetClient

func GetClient() *calendar.Service

func GoogleSetup added in v1.1.0

func GoogleSetup(c *cli.Context)

func InsertTask added in v1.1.0

func InsertTask(c *cli.Context)

func ShowAlias added in v1.2.0

func ShowAlias(c *cli.Context)

func StartTask

func StartTask(c *cli.Context)

func TaskStatus

func TaskStatus(c *cli.Context)

Types

type DataTask

type DataTask struct {
	Name  string
	Start string
}

func (*DataTask) Reset added in v1.1.0

func (f *DataTask) Reset()

type FileData

type FileData struct {
	CalendarId  string
	CurrentTask DataTask
	TaskAlias   map[string]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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