Skip to content

Commit

Permalink
chore: switch module origin to kcoderhtml/hackatime
Browse files Browse the repository at this point in the history
  • Loading branch information
taciturnaxolotl committed Sep 11, 2024
1 parent 13d8fed commit ebe12bb
Show file tree
Hide file tree
Showing 138 changed files with 674 additions and 576 deletions.
7 changes: 4 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ import (

"github.com/duke-git/lancet/v2/slice"

"log/slog"

"github.com/gofrs/uuid/v5"
"github.com/gorilla/securecookie"
"github.com/jinzhu/configor"
"github.com/muety/wakapi/data"
"github.com/muety/wakapi/utils"
"github.com/kcoderhtml/hackatime/data"
"github.com/kcoderhtml/hackatime/utils"
"github.com/robfig/cron/v3"
"log/slog"
)

const (
Expand Down
5 changes: 3 additions & 2 deletions config/jobqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package config

import (
"fmt"
"github.com/muety/artifex/v2"
"github.com/muety/wakapi/utils"
"log/slog"

"github.com/kcoderhtml/hackatime/utils"
"github.com/muety/artifex/v2"
)

var jobQueues map[string]*artifex.Dispatcher
Expand Down
3 changes: 2 additions & 1 deletion helpers/date.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package helpers

import (
"fmt"
"github.com/muety/wakapi/config"
"time"

"github.com/kcoderhtml/hackatime/config"
)

// ParseDateTimeTZ attempts to parse the given date string from multiple formats.
Expand Down
5 changes: 3 additions & 2 deletions helpers/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package helpers
import (
"encoding/json"
"errors"
"github.com/muety/wakapi/config"
"github.com/muety/wakapi/models"
"net/http"

"github.com/kcoderhtml/hackatime/config"
"github.com/kcoderhtml/hackatime/models"
)

func ExtractCookieAuth(r *http.Request, config *config.Config) (username *string, err error) {
Expand Down
5 changes: 3 additions & 2 deletions helpers/interval.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package helpers

import (
"errors"
"github.com/muety/wakapi/models"
"github.com/muety/wakapi/utils"
"time"

"github.com/kcoderhtml/hackatime/models"
"github.com/kcoderhtml/hackatime/utils"
)

func ParseInterval(interval string) (*models.IntervalKey, error) {
Expand Down
5 changes: 3 additions & 2 deletions helpers/interval_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package helpers

import (
"github.com/muety/wakapi/models"
"github.com/stretchr/testify/assert"
"testing"
"time"

"github.com/kcoderhtml/hackatime/models"
"github.com/stretchr/testify/assert"
)

func TestResolveMaximumRange_Default(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion helpers/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package helpers

import (
"errors"
"github.com/muety/wakapi/models"
"net/http"
"time"

"github.com/kcoderhtml/hackatime/models"
)

func ParseSummaryParams(r *http.Request) (*models.SummaryParams, error) {
Expand Down
26 changes: 13 additions & 13 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ import (
"gorm.io/gorm"
"gorm.io/gorm/logger"

conf "github.com/muety/wakapi/config"
"github.com/muety/wakapi/middlewares"
"github.com/muety/wakapi/migrations"
"github.com/muety/wakapi/repositories"
"github.com/muety/wakapi/routes"
"github.com/muety/wakapi/routes/api"
shieldsV1Routes "github.com/muety/wakapi/routes/compat/shields/v1"
wtV1Routes "github.com/muety/wakapi/routes/compat/wakatime/v1"
"github.com/muety/wakapi/routes/relay"
"github.com/muety/wakapi/services"
"github.com/muety/wakapi/services/mail"
"github.com/muety/wakapi/static/docs"
fsutils "github.com/muety/wakapi/utils/fs"
conf "github.com/kcoderhtml/hackatime/config"
"github.com/kcoderhtml/hackatime/middlewares"
"github.com/kcoderhtml/hackatime/migrations"
"github.com/kcoderhtml/hackatime/repositories"
"github.com/kcoderhtml/hackatime/routes"
"github.com/kcoderhtml/hackatime/routes/api"
shieldsV1Routes "github.com/kcoderhtml/hackatime/routes/compat/shields/v1"
wtV1Routes "github.com/kcoderhtml/hackatime/routes/compat/wakatime/v1"
"github.com/kcoderhtml/hackatime/routes/relay"
"github.com/kcoderhtml/hackatime/services"
"github.com/kcoderhtml/hackatime/services/mail"
"github.com/kcoderhtml/hackatime/static/docs"
fsutils "github.com/kcoderhtml/hackatime/utils/fs"

_ "net/http/pprof"
)
Expand Down
13 changes: 7 additions & 6 deletions middlewares/authenticate.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ package middlewares
import (
"errors"
"fmt"
"github.com/duke-git/lancet/v2/slice"
"github.com/muety/wakapi/helpers"
"net"
"net/http"
"strings"

conf "github.com/muety/wakapi/config"
"github.com/muety/wakapi/models"
"github.com/muety/wakapi/services"
"github.com/muety/wakapi/utils"
"github.com/duke-git/lancet/v2/slice"
"github.com/kcoderhtml/hackatime/helpers"

conf "github.com/kcoderhtml/hackatime/config"
"github.com/kcoderhtml/hackatime/models"
"github.com/kcoderhtml/hackatime/services"
"github.com/kcoderhtml/hackatime/utils"
)

const (
Expand Down
7 changes: 4 additions & 3 deletions middlewares/authenticate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package middlewares
import (
"encoding/base64"
"fmt"
"github.com/muety/wakapi/config"
"net/http"
"net/url"
"testing"

"github.com/muety/wakapi/mocks"
"github.com/muety/wakapi/models"
"github.com/kcoderhtml/hackatime/config"

"github.com/kcoderhtml/hackatime/mocks"
"github.com/kcoderhtml/hackatime/models"
"github.com/stretchr/testify/assert"
)

Expand Down
13 changes: 7 additions & 6 deletions middlewares/custom/wakatime.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/leandro-lugaresi/hub"
"github.com/muety/wakapi/config"
"github.com/muety/wakapi/middlewares"
"github.com/muety/wakapi/models"
routeutils "github.com/muety/wakapi/routes/utils"
"github.com/patrickmn/go-cache"
"io"
"log/slog"
"net/http"
"time"

"github.com/kcoderhtml/hackatime/config"
"github.com/kcoderhtml/hackatime/middlewares"
"github.com/kcoderhtml/hackatime/models"
routeutils "github.com/kcoderhtml/hackatime/routes/utils"
"github.com/leandro-lugaresi/hub"
"github.com/patrickmn/go-cache"
)

const maxFailuresPerDay = 100
Expand Down
3 changes: 2 additions & 1 deletion middlewares/principal.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package middlewares

import (
"context"
"github.com/muety/wakapi/models"
"net/http"

"github.com/kcoderhtml/hackatime/models"
)

const keyPrincipal = "principal"
Expand Down
7 changes: 4 additions & 3 deletions migrations/20201103_rename_language_mappings_table.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package migrations

import (
"github.com/muety/wakapi/config"
"github.com/muety/wakapi/models"
"gorm.io/gorm"
"log/slog"

"github.com/kcoderhtml/hackatime/config"
"github.com/kcoderhtml/hackatime/models"
"gorm.io/gorm"
)

func init() {
Expand Down
7 changes: 4 additions & 3 deletions migrations/20201106_migration_cascade_constraints.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package migrations

import (
"github.com/muety/wakapi/config"
"github.com/muety/wakapi/models"
"gorm.io/gorm"
"log/slog"

"github.com/kcoderhtml/hackatime/config"
"github.com/kcoderhtml/hackatime/models"
"gorm.io/gorm"
)

func init() {
Expand Down
7 changes: 4 additions & 3 deletions migrations/20210202_fix_cascade_for_alias_user_constraint.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package migrations

import (
"github.com/muety/wakapi/config"
"github.com/muety/wakapi/models"
"gorm.io/gorm"
"log/slog"

"github.com/kcoderhtml/hackatime/config"
"github.com/kcoderhtml/hackatime/models"
"gorm.io/gorm"
)

func init() {
Expand Down
7 changes: 4 additions & 3 deletions migrations/20210206_drop_badges_column_add_sharing_flags.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package migrations

import (
"github.com/muety/wakapi/config"
"github.com/muety/wakapi/models"
"gorm.io/gorm"
"log/slog"

"github.com/kcoderhtml/hackatime/config"
"github.com/kcoderhtml/hackatime/models"
"gorm.io/gorm"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion migrations/20210213_add_has_data_field.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package migrations

import (
"github.com/muety/wakapi/config"
"github.com/kcoderhtml/hackatime/config"
"gorm.io/gorm"
)

Expand Down
2 changes: 1 addition & 1 deletion migrations/20210221_add_created_date_column.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package migrations

import (
"github.com/muety/wakapi/config"
"github.com/kcoderhtml/hackatime/config"
"gorm.io/gorm"
)

Expand Down
6 changes: 3 additions & 3 deletions migrations/20210411_add_imprint_content.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package migrations

import (
"github.com/muety/wakapi/config"
"github.com/muety/wakapi/models"
"github.com/muety/wakapi/utils"
"github.com/kcoderhtml/hackatime/config"
"github.com/kcoderhtml/hackatime/models"
"github.com/kcoderhtml/hackatime/utils"
"gorm.io/gorm"
"gorm.io/gorm/clause"
)
Expand Down
5 changes: 3 additions & 2 deletions migrations/20210411_drop_migrations_table.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package migrations

import (
"github.com/muety/wakapi/config"
"gorm.io/gorm"
"log/slog"

"github.com/kcoderhtml/hackatime/config"
"gorm.io/gorm"
)

func init() {
Expand Down
7 changes: 4 additions & 3 deletions migrations/20210806_remove_persisted_project_labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package migrations

import (
"fmt"
"github.com/muety/wakapi/config"
"github.com/muety/wakapi/models"
"gorm.io/gorm"
"log/slog"

"github.com/kcoderhtml/hackatime/config"
"github.com/kcoderhtml/hackatime/models"
"gorm.io/gorm"
)

func init() {
Expand Down
5 changes: 3 additions & 2 deletions migrations/20211215_migrate_id_to_bigint.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package migrations

import (
"github.com/muety/wakapi/config"
"gorm.io/gorm"
"log/slog"

"github.com/kcoderhtml/hackatime/config"
"gorm.io/gorm"
)

func init() {
Expand Down
7 changes: 4 additions & 3 deletions migrations/20212212_total_summary_heartbeats.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package migrations

import (
"database/sql"
"github.com/muety/wakapi/config"
"github.com/muety/wakapi/models"
"gorm.io/gorm"
"log/slog"

"github.com/kcoderhtml/hackatime/config"
"github.com/kcoderhtml/hackatime/models"
"gorm.io/gorm"
)

func init() {
Expand Down
7 changes: 4 additions & 3 deletions migrations/20220317_align_num_heartbeats.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package migrations

import (
"github.com/muety/wakapi/config"
"github.com/muety/wakapi/models"
"gorm.io/gorm"
"log/slog"

"github.com/kcoderhtml/hackatime/config"
"github.com/kcoderhtml/hackatime/models"
"gorm.io/gorm"
)

func init() {
Expand Down
5 changes: 3 additions & 2 deletions migrations/20220318_mysql_timestamp_precision.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package migrations

import (
"github.com/muety/wakapi/config"
"gorm.io/gorm"
"log/slog"

"github.com/kcoderhtml/hackatime/config"
"gorm.io/gorm"
)

func init() {
Expand Down
7 changes: 4 additions & 3 deletions migrations/202203191_drop_diagnostics_user.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package migrations

import (
"github.com/muety/wakapi/config"
"github.com/muety/wakapi/models"
"gorm.io/gorm"
"log/slog"

"github.com/kcoderhtml/hackatime/config"
"github.com/kcoderhtml/hackatime/models"
"gorm.io/gorm"
)

func init() {
Expand Down
Loading

0 comments on commit ebe12bb

Please sign in to comment.