-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
539 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Go | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
go-version: [1.12.9, 1.13] | ||
platform: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Checkout code | ||
uses: actions/checkout@v1 | ||
- name: Test | ||
run: go test ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,30 @@ | ||
module livingit.de/code/timenote | ||
|
||
require ( | ||
github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705 // indirect | ||
github.com/chzyer/logex v1.1.10 // indirect | ||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e | ||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect | ||
github.com/coreos/etcd v3.3.13+incompatible // indirect | ||
github.com/coreos/go-semver v0.3.0 // indirect | ||
github.com/go-ole/go-ole v1.2.4 // indirect | ||
github.com/go-sql-driver/mysql v1.4.1 | ||
github.com/golang/protobuf v1.3.1 // indirect | ||
github.com/google/gops v0.3.6 | ||
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect | ||
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect | ||
github.com/magiconair/properties v1.8.1 // indirect | ||
github.com/mgutz/str v1.2.0 | ||
github.com/mitchellh/go-homedir v1.1.0 | ||
github.com/onsi/ginkgo v1.8.0 // indirect | ||
github.com/onsi/gomega v1.5.0 // indirect | ||
github.com/onsi/ginkgo v1.10.1 | ||
github.com/onsi/gomega v1.7.0 | ||
github.com/pelletier/go-toml v1.4.0 // indirect | ||
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 | ||
github.com/pkg/errors v0.8.1 | ||
github.com/russross/blackfriday v2.0.0+incompatible // indirect | ||
github.com/sascha-andres/go-toggl v0.0.0-20190124051419-9384593946d2 | ||
github.com/shirou/gopsutil v2.18.12+incompatible // indirect | ||
github.com/sascha-andres/go-toggl v1.1.0 | ||
github.com/sirupsen/logrus v1.4.2 | ||
github.com/spf13/afero v1.2.2 // indirect | ||
github.com/spf13/cobra v0.0.4 | ||
github.com/spf13/cobra v0.0.5 | ||
github.com/spf13/jwalterweatherman v1.1.0 // indirect | ||
github.com/spf13/viper v1.3.2 | ||
github.com/stretchr/objx v0.2.0 // indirect | ||
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca // indirect | ||
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f // indirect | ||
golang.org/x/net v0.0.0-20190520210107-018c4d40a106 // indirect | ||
golang.org/x/sys v0.0.0-20190522034248-c46e0d965b18 // indirect | ||
golang.org/x/text v0.3.2 // indirect | ||
golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd // indirect | ||
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect | ||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect | ||
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect | ||
rsc.io/goversion v1.2.0 // indirect | ||
github.com/spf13/viper v1.4.0 | ||
github.com/stretchr/testify v1.3.0 // indirect | ||
golang.org/x/sys v0.0.0-20190610200419-93c9922d18ae // indirect | ||
google.golang.org/appengine v1.6.1 // indirect | ||
) | ||
|
||
go 1.13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright © 2018 Sascha Andres <sascha.andres@outlook.com> | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
log "github.com/sirupsen/logrus" | ||
"github.com/spf13/cobra" | ||
"github.com/spf13/viper" | ||
"livingit.de/code/timenote/persistence/factory" | ||
) | ||
|
||
// timestampCurrentCmd represents the current command | ||
var timestampDescriptionCmd = &cobra.Command{ | ||
Use: "description", | ||
Short: "Print current timestamp description", | ||
Long: `Prints the current timestamp's description`, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
persistence, err := factory.CreatePersistence(viper.GetString("persistor"), viper.GetString("dsn")) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
defer func() { | ||
err := persistence.Close() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
}() | ||
|
||
ts, err := persistence.Current() | ||
if err != nil { | ||
log.Error(err) | ||
return | ||
} | ||
fmt.Println(ts.Note) | ||
}, | ||
} | ||
|
||
func init() { | ||
timestampCmd.AddCommand(timestampDescriptionCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.