Skip to content

Commit

Permalink
refactor: project name; pigil
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthBenro008 committed Jun 15, 2022
1 parent e4adb58 commit 962f935
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/
*.database
.env
pigil
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module gnoty
module pigil

go 1.17

Expand Down
8 changes: 4 additions & 4 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package main
import (
"context"
"fmt"
"gnoty/internal/database"
service2 "gnoty/internal/service"
"gnoty/internal/types"
"gnoty/internal/utils"
"golang.org/x/oauth2"
"log"
"pigil/internal/database"
service2 "pigil/internal/service"
"pigil/internal/types"
"pigil/internal/utils"
)

func InsertCommand(service database.Service,
Expand Down
4 changes: 2 additions & 2 deletions internal/database/bolt.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package database

import (
"encoding/json"
"gnoty/internal/types"
"gnoty/internal/utils"
bolt "go.etcd.io/bbolt"
"pigil/internal/types"
"pigil/internal/utils"
"strconv"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/database/configuration_database.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package database

import "gnoty/internal/types"
import "pigil/internal/types"

type configurationDatabase interface {
InsertConfig(information types.ConfigurationInformation) error
Expand Down
2 changes: 1 addition & 1 deletion internal/database/local_database.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package database

import "gnoty/internal/types"
import "pigil/internal/types"

type localDatabase interface {
Insert(information types.CommandInformation) error
Expand Down
4 changes: 2 additions & 2 deletions internal/service/emailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ func SendEmail(client *http.Client, email string) {
if err != nil {
log.Fatal(err.Error())
}
emailBody := "This is an test email from gnoty!"
emailBody := "This is an test email from pigil!"
if err != nil {
log.Fatal(err.Error())
}

var message gmail.Message

emailTo := "To: " + email + "\r\n"
subject := "Subject: " + "Gnoty sends regards!" + "\n"
subject := "Subject: " + "Pigil sends regards!" + "\n"
mime := "MIME-version: 1.0;\nContent-Type: text/plain; charset=\"UTF-8\";\n\n"
msg := []byte(emailTo + subject + mime + "\n" + emailBody)

Expand Down
6 changes: 3 additions & 3 deletions internal/service/oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"context"
"encoding/json"
"fmt"
"gnoty/internal/types"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"log"
"net/http"
"os"
"pigil/internal/types"
)

func OAuthGoogleConfig() *oauth2.Config {
Expand All @@ -26,7 +26,7 @@ func OAuthGoogleConfig() *oauth2.Config {
func GoogleLogin(config *oauth2.Config) *oauth2.Config {
//TODO: state generation
url := config.AuthCodeURL("", oauth2.AccessTypeOffline)
fmt.Printf("Click on this link to authenticate yourself with gnoty! \n%s"+
fmt.Printf("Click on this link to authenticate yourself with pigil! \n%s"+
"\n", url)
return config
}
Expand All @@ -49,7 +49,7 @@ func GoogleCallback(config *oauth2.Config) types.UserInformation {
fmt.Println(token.AccessToken)
w.WriteHeader(http.StatusCreated)
_, err = fmt.Fprintf(w,
"Your email has been linked via gnoty! You can close this webpage"+
"Your email has been linked via pigil! You can close this webpage"+
" now!")
if err != nil {
log.Fatal(err.Error())
Expand Down
6 changes: 3 additions & 3 deletions internal/utils/constants.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package utils

const (
LocalBucket = "gnoty_storage"
ConfigBucket = "gnoty_config"
LocalBucket = "pigil_storage"
ConfigBucket = "pigil_config"
CliDb = "db"
CliAuth = "auth"
CliStatus = "status"
CliLogout = "logout"
UserEmail = "email"
UserAT = "access_token"
UserRT = "refresh_token"
DatabaseName = "gnoty.database"
DatabaseName = "pigil.database"
)
2 changes: 1 addition & 1 deletion internal/utils/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package utils

import (
"github.com/jedib0t/go-pretty/v6/table"
"gnoty/internal/types"
"os"
"pigil/internal/types"
"time"
)

Expand Down
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package main
import (
"fmt"
"github.com/joho/godotenv"
"gnoty/internal/database"
"gnoty/internal/types"
"gnoty/internal/utils"
bolt "go.etcd.io/bbolt"
"io"
"log"
"os"
"os/exec"
"pigil/internal/database"
"pigil/internal/types"
"pigil/internal/utils"
"time"
)

Expand Down Expand Up @@ -61,7 +61,7 @@ func executor(args []string, service database.Service) {
}
start := time.Now()
if err := cmd.Start(); err != nil {
log.Fatal("gnoty info:", err)
log.Fatal("pigil info:", err)
}
ci := types.CommandInformation{
CommandName: args[1],
Expand Down

0 comments on commit 962f935

Please sign in to comment.