Skip to content

Commit

Permalink
Rename package
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno M V Souza authored and brunomvsouza committed Jan 24, 2023
1 parent 6d1b740 commit d04103f
Show file tree
Hide file tree
Showing 40 changed files with 92 additions and 122 deletions.
7 changes: 1 addition & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ os:
go:
- 1.x

go_import_path: go.bmvs.io/ynab
go_import_path: github.com/brunomvsouza/ynab.go

sudo: false

Expand All @@ -21,11 +21,6 @@ before_install:
script:
- make lint
- make test
- make race
- make msan

after_success:
- make goveralls

notifications:
email:
Expand Down
40 changes: 5 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,46 +1,16 @@
#!/usr/bin/env bash

PROJECT_NAME := "ynab"
PKG := "go.bmvs.io/$(PROJECT_NAME)"
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)

.PHONY: all dep build clean test coverage coverhtml lint

all: build
.PHONY: lint test coverage help

lint: ## Lint the files
@go get -u golang.org/x/lint/golint
@golint -set_exit_status ${PKG_LIST}
@go install github.com/golangci/golangci-lint/cmd/[email protected]
@golangci-lint run

test: ## Run unittests
@go test -short ${PKG_LIST}

race: dep ## Run data race detector
@go test -race -short ${PKG_LIST}

msan: dep ## Run memory sanitizer
@env CC=clang-4.0 go test -msan -short ${PKG_LIST}
@go test -race -short ./...

coverage: ## Generate global code coverage report
./coverage.sh;

coverhtml: ## Generate global code coverage report in HTML
./coverage.sh html;

goveralls:
@go get golang.org/x/tools/cmd/cover
@go get github.com/mattn/goveralls
@goveralls -service=travis-ci

dep: ## Get the dependencies
@go get -v -d ./...

build: dep ## Build the binary file
@go build -i -v $(PKG)

clean: ## Remove previous build
@rm -f $(PROJECT_NAME)
@./coverage.sh;

help: ## Display this help screen
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# YNAB API Go Library

[![Build Status](https://travis-ci.com/brunomvsouza/ynab.go.svg?branch=master)](https://travis-ci.com/brunomvsouza/ynab.go) [![Build Status](https://ci.appveyor.com/api/projects/status/0m2n0q97usi79q27/branch/master?svg=true)](https://ci.appveyor.com/project/brunomvsouza/ynab-go-y5fjk/branch/master) [![Coverage Status](https://coveralls.io/repos/github/brunomvsouza/ynab.go/badge.svg?branch=master)](https://coveralls.io/github/brunomvsouza/ynab.go?branch=master) [![Go Report Card](https://goreportcard.com/badge/lab.bmvs.io/bs/ynab.go)](https://goreportcard.com/report/lab.bmvs.io/bs/ynab.go) [![GoDoc Reference](https://godoc.org/go.bmvs.io/ynab?status.svg)](https://godoc.org/go.bmvs.io/ynab)
[![Build Status](https://travis-ci.com/brunomvsouza/ynab.go.svg?branch=master)](https://travis-ci.com/brunomvsouza/ynab.go) [![Build Status](https://ci.appveyor.com/api/projects/status/0m2n0q97usi79q27/branch/master?svg=true)](https://ci.appveyor.com/project/brunomvsouza/ynab-go-y5fjk/branch/master) [![Go Report Card](https://goreportcard.com/badge/github.com/brunomvsouza/ynab.go)](https://goreportcard.com/report/github.com/brunomvsouza/ynab.go) [![GoDoc Reference](https://godoc.org/github.com/brunomvsouza/ynab.go?status.svg)](https://godoc.org/github.com/brunomvsouza/ynab.go)

This is an UNOFFICIAL Go client for the YNAB API. It covers 100% of the resources made available by the [YNAB API](https://api.youneedabudget.com).

## Installation

```
go get go.bmvs.io/ynab
go get github.com/brunomvsouza/ynab.go
```

## Usage
Expand All @@ -20,7 +20,7 @@ package main
import (
"fmt"

"go.bmvs.io/ynab"
"github.com/brunomvsouza/ynab.go"
)

const accessToken = "bf0cbb14b4330-not-real-3de12e66a389eaafe2"
Expand All @@ -39,7 +39,7 @@ func main() {
}
```

See the [godoc](https://godoc.org/go.bmvs.io/ynab) to see all the available methods with example usage.
See the [godoc](https://godoc.org/github.com/brunomvsouza/ynab.go) to see all the available methods with example usage.

## Development

Expand Down
2 changes: 1 addition & 1 deletion api/account/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// found in the LICENSE file.

// Package account implements account entities and services
package account // import "go.bmvs.io/ynab/api/account"
package account // import "github.com/brunomvsouza/ynab.go/api/account"

// Account represents an account for a budget
type Account struct {
Expand Down
4 changes: 2 additions & 2 deletions api/account/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"fmt"
"reflect"

"go.bmvs.io/ynab"
"go.bmvs.io/ynab/api"
"github.com/brunomvsouza/ynab.go"
"github.com/brunomvsouza/ynab.go/api"
)

func ExampleService_GetAccount() {
Expand Down
2 changes: 1 addition & 1 deletion api/account/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package account
import (
"fmt"

"go.bmvs.io/ynab/api"
"github.com/brunomvsouza/ynab.go/api"
)

// NewService facilitates the creation of a new account service instance
Expand Down
6 changes: 3 additions & 3 deletions api/account/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"net/http"
"testing"

"go.bmvs.io/ynab/api"
"github.com/brunomvsouza/ynab.go/api"

"github.com/stretchr/testify/assert"
"gopkg.in/jarcoal/httpmock.v1"

"go.bmvs.io/ynab"
"go.bmvs.io/ynab/api/account"
"github.com/brunomvsouza/ynab.go"
"github.com/brunomvsouza/ynab.go/api/account"
)

func TestService_GetAccounts(t *testing.T) {
Expand Down
14 changes: 7 additions & 7 deletions api/budget/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
// found in the LICENSE file.

// Package budget implements budget entities and services
package budget // import "go.bmvs.io/ynab/api/budget"
package budget // import "github.com/brunomvsouza/ynab.go/api/budget"

import (
"time"

"go.bmvs.io/ynab/api"
"go.bmvs.io/ynab/api/account"
"go.bmvs.io/ynab/api/category"
"go.bmvs.io/ynab/api/month"
"go.bmvs.io/ynab/api/payee"
"go.bmvs.io/ynab/api/transaction"
"github.com/brunomvsouza/ynab.go/api"
"github.com/brunomvsouza/ynab.go/api/account"
"github.com/brunomvsouza/ynab.go/api/category"
"github.com/brunomvsouza/ynab.go/api/month"
"github.com/brunomvsouza/ynab.go/api/payee"
"github.com/brunomvsouza/ynab.go/api/transaction"
)

// Budget represents a budget
Expand Down
4 changes: 2 additions & 2 deletions api/budget/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"fmt"
"reflect"

"go.bmvs.io/ynab/api"
"github.com/brunomvsouza/ynab.go/api"

"go.bmvs.io/ynab"
"github.com/brunomvsouza/ynab.go"
)

func ExampleService_GetBudget() {
Expand Down
2 changes: 1 addition & 1 deletion api/budget/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package budget
import (
"fmt"

"go.bmvs.io/ynab/api"
"github.com/brunomvsouza/ynab.go/api"
)

// NewService facilitates the creation of a new budget service instance
Expand Down
6 changes: 3 additions & 3 deletions api/budget/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/stretchr/testify/assert"
"gopkg.in/jarcoal/httpmock.v1"

"go.bmvs.io/ynab"
"go.bmvs.io/ynab/api"
"go.bmvs.io/ynab/api/budget"
"github.com/brunomvsouza/ynab.go"
"github.com/brunomvsouza/ynab.go/api"
"github.com/brunomvsouza/ynab.go/api/budget"
)

func TestService_GetBudgets(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions api/category/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// found in the LICENSE file.

// Package category implements category entities and services
package category // import "go.bmvs.io/ynab/api/category"
package category // import "github.com/brunomvsouza/ynab.go/api/category"

import "go.bmvs.io/ynab/api"
import "github.com/brunomvsouza/ynab.go/api"

// Category represents a category for a budget
type Category struct {
Expand Down
6 changes: 3 additions & 3 deletions api/category/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ package category_test
import (
"fmt"

"go.bmvs.io/ynab/api/category"
"github.com/brunomvsouza/ynab.go/api/category"

"reflect"

"go.bmvs.io/ynab"
"go.bmvs.io/ynab/api"
"github.com/brunomvsouza/ynab.go"
"github.com/brunomvsouza/ynab.go/api"
)

func ExampleService_GetCategory() {
Expand Down
2 changes: 1 addition & 1 deletion api/category/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"encoding/json"
"fmt"

"go.bmvs.io/ynab/api"
"github.com/brunomvsouza/ynab.go/api"
)

const currentMonthID = "current"
Expand Down
6 changes: 3 additions & 3 deletions api/category/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/stretchr/testify/assert"
"gopkg.in/jarcoal/httpmock.v1"

"go.bmvs.io/ynab"
"go.bmvs.io/ynab/api"
"go.bmvs.io/ynab/api/category"
"github.com/brunomvsouza/ynab.go"
"github.com/brunomvsouza/ynab.go/api"
"github.com/brunomvsouza/ynab.go/api/category"
)

func TestService_GetCategories(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// Package api implements shared structures and behaviours of
// the API services
package api // import "go.bmvs.io/ynab/api"
package api // import "github.com/brunomvsouza/ynab.go/api"

// ClientReader contract for a read only client
type ClientReader interface {
Expand Down
2 changes: 1 addition & 1 deletion api/date_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/stretchr/testify/assert"

"go.bmvs.io/ynab/api"
"github.com/brunomvsouza/ynab.go/api"
)

func TestDate_UnmarshalJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package api_test
import (
"fmt"

"go.bmvs.io/ynab/api"
"github.com/brunomvsouza/ynab.go/api"
)

func ExampleDateFromString() {
Expand Down
2 changes: 1 addition & 1 deletion api/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/stretchr/testify/assert"

"go.bmvs.io/ynab/api"
"github.com/brunomvsouza/ynab.go/api"
)

func TestFilter_ToQuery(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions api/month/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
// found in the LICENSE file.

// Package month implements month entities and services
package month // import "go.bmvs.io/ynab/api/month"
package month // import "github.com/brunomvsouza/ynab.go/api/month"

import (
"go.bmvs.io/ynab/api"
"go.bmvs.io/ynab/api/category"
"github.com/brunomvsouza/ynab.go/api"
"github.com/brunomvsouza/ynab.go/api/category"
)

// Month represents a month for a budget
Expand Down
4 changes: 2 additions & 2 deletions api/month/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"fmt"
"reflect"

"go.bmvs.io/ynab"
"go.bmvs.io/ynab/api"
"github.com/brunomvsouza/ynab.go"
"github.com/brunomvsouza/ynab.go/api"
)

func ExampleService_GetMonth() {
Expand Down
2 changes: 1 addition & 1 deletion api/month/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package month
import (
"fmt"

"go.bmvs.io/ynab/api"
"github.com/brunomvsouza/ynab.go/api"
)

// NewService facilitates the creation of a new month service instance
Expand Down
4 changes: 2 additions & 2 deletions api/month/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/stretchr/testify/assert"
"gopkg.in/jarcoal/httpmock.v1"

"go.bmvs.io/ynab"
"go.bmvs.io/ynab/api"
"github.com/brunomvsouza/ynab.go"
"github.com/brunomvsouza/ynab.go/api"
)

func TestService_GetMonths(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/payee/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// found in the LICENSE file.

// Package payee implements payee entities and services
package payee // import "go.bmvs.io/ynab/api/payee"
package payee // import "github.com/brunomvsouza/ynab.go/api/payee"

// Payee represents a payee for a budget
type Payee struct {
Expand Down
4 changes: 2 additions & 2 deletions api/payee/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"fmt"
"reflect"

"go.bmvs.io/ynab/api"
"github.com/brunomvsouza/ynab.go/api"

"go.bmvs.io/ynab"
"github.com/brunomvsouza/ynab.go"
)

func ExampleService_GetPayee() {
Expand Down
2 changes: 1 addition & 1 deletion api/payee/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package payee
import (
"fmt"

"go.bmvs.io/ynab/api"
"github.com/brunomvsouza/ynab.go/api"
)

// NewService facilitates the creation of a new payee service instance
Expand Down
6 changes: 3 additions & 3 deletions api/payee/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"strconv"
"testing"

"go.bmvs.io/ynab/api"
"github.com/brunomvsouza/ynab.go/api"

"github.com/stretchr/testify/assert"
"gopkg.in/jarcoal/httpmock.v1"

"go.bmvs.io/ynab"
"go.bmvs.io/ynab/api/payee"
"github.com/brunomvsouza/ynab.go"
"github.com/brunomvsouza/ynab.go/api/payee"
)

func TestService_GetPayees(t *testing.T) {
Expand Down
Loading

0 comments on commit d04103f

Please sign in to comment.