Skip to content

Commit

Permalink
libgm: remove go.mod and move into pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Aug 15, 2024
1 parent 83bd0b1 commit 96b2192
Show file tree
Hide file tree
Showing 78 changed files with 67 additions and 187 deletions.
12 changes: 5 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ go 1.22

require (
github.com/gabriel-vasile/mimetype v1.4.5
github.com/google/uuid v1.6.0
github.com/rs/zerolog v1.33.0
go.mau.fi/mautrix-gmessages/libgm v0.4.3
github.com/stretchr/testify v1.9.0
go.mau.fi/util v0.6.1-0.20240815104112-77362c9b05dd
golang.org/x/crypto v0.26.0
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa
google.golang.org/protobuf v1.34.2
gopkg.in/yaml.v3 v3.0.1
Expand All @@ -15,7 +17,7 @@ require (

require (
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
Expand All @@ -24,6 +26,7 @@ require (
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-sqlite3 v1.14.22 // indirect
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/rs/xid v1.5.0 // indirect
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect
Expand All @@ -33,15 +36,10 @@ require (
github.com/tidwall/sjson v1.2.5 // indirect
github.com/yuin/goldmark v1.7.4 // indirect
go.mau.fi/zeroconfig v0.1.3 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.17.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
maunium.net/go/mauflag v1.0.0 // indirect
)

replace go.mau.fi/mautrix-gmessages/libgm => ./libgm

//replace maunium.net/go/mautrix => ../mautrix-go
21 changes: 0 additions & 21 deletions libgm/gmtest/go.mod

This file was deleted.

37 changes: 0 additions & 37 deletions libgm/gmtest/go.sum

This file was deleted.

22 changes: 0 additions & 22 deletions libgm/go.mod

This file was deleted.

38 changes: 0 additions & 38 deletions libgm/go.sum

This file was deleted.

4 changes: 2 additions & 2 deletions pkg/connector/backfill.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
"maunium.net/go/mautrix/bridgev2"
"maunium.net/go/mautrix/bridgev2/networkid"

"go.mau.fi/mautrix-gmessages/libgm"
"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
)

var _ bridgev2.BackfillingNetworkAPI = (*GMClient)(nil)
Expand Down
2 changes: 1 addition & 1 deletion pkg/connector/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"maunium.net/go/mautrix/bridgev2"
"maunium.net/go/mautrix/bridgev2/database"

"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
)

var generalCaps = &bridgev2.NetworkGeneralCapabilities{
Expand Down
2 changes: 1 addition & 1 deletion pkg/connector/chatinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"maunium.net/go/mautrix/bridgev2/networkid"
"maunium.net/go/mautrix/event"

"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
)

var _ bridgev2.PortalBridgeInfoFillingNetwork = (*GMConnector)(nil)
Expand Down
2 changes: 1 addition & 1 deletion pkg/connector/chatsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"maunium.net/go/mautrix/bridgev2/networkid"
"maunium.net/go/mautrix/bridgev2/simplevent"

"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
)

func (gc *GMClient) SyncConversations(ctx context.Context, lastDataReceived time.Time, minimalSync bool) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/connector/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
"maunium.net/go/mautrix/bridgev2"
"maunium.net/go/mautrix/bridgev2/networkid"

"go.mau.fi/mautrix-gmessages/libgm"
"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
)

type conversationMeta struct {
Expand Down
4 changes: 2 additions & 2 deletions pkg/connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (

"maunium.net/go/mautrix/bridgev2"

"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/libgm/util"
"go.mau.fi/mautrix-gmessages/pkg/connector/gmdb"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm/util"
)

type GMConnector struct {
Expand Down
4 changes: 2 additions & 2 deletions pkg/connector/dbmeta.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"go.mau.fi/util/jsontime"
"maunium.net/go/mautrix/bridgev2/database"

"go.mau.fi/mautrix-gmessages/libgm"
"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
)

func (gc *GMConnector) GetDBMetaTypes() database.MetaTypes {
Expand Down
2 changes: 1 addition & 1 deletion pkg/connector/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"fmt"
"strings"

"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
)

var ()
Expand Down
6 changes: 3 additions & 3 deletions pkg/connector/handlegmessages.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ import (
"maunium.net/go/mautrix/event"
"maunium.net/go/mautrix/id"

"go.mau.fi/mautrix-gmessages/libgm"
"go.mau.fi/mautrix-gmessages/libgm/events"
"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm"
"go.mau.fi/mautrix-gmessages/pkg/libgm/events"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
)

func (gc *GMClient) handleGMEvent(rawEvt any) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/connector/handlematrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
"maunium.net/go/mautrix/bridgev2/networkid"
"maunium.net/go/mautrix/event"

"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/libgm/util"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm/util"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions pkg/connector/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
"maunium.net/go/mautrix/bridgev2/database"
"maunium.net/go/mautrix/bridgev2/networkid"

"go.mau.fi/mautrix-gmessages/libgm"
"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/connector/messagestatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

"maunium.net/go/mautrix/bridgev2"

"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
)

func isSuccessfullySentStatus(status gmproto.MessageStatusType) bool {
Expand Down
2 changes: 1 addition & 1 deletion pkg/connector/startchat.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"maunium.net/go/mautrix/bridgev2"
"maunium.net/go/mautrix/bridgev2/networkid"

"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
)

var (
Expand Down
8 changes: 4 additions & 4 deletions libgm/client.go → pkg/libgm/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import (
"github.com/google/uuid"
"github.com/rs/zerolog"

"go.mau.fi/mautrix-gmessages/libgm/crypto"
"go.mau.fi/mautrix-gmessages/libgm/events"
"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/libgm/util"
"go.mau.fi/mautrix-gmessages/pkg/libgm/crypto"
"go.mau.fi/mautrix-gmessages/pkg/libgm/events"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm/util"
)

type AuthData struct {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions libgm/event_handler.go → pkg/libgm/event_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"google.golang.org/protobuf/proto"

"go.mau.fi/mautrix-gmessages/libgm/events"
"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm/events"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
)

type IncomingRPCMessage struct {
Expand Down
2 changes: 1 addition & 1 deletion libgm/events/qr.go → pkg/libgm/events/qr.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package events

import (
"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
)

type QR struct {
Expand Down
2 changes: 1 addition & 1 deletion libgm/events/ready.go → pkg/libgm/events/ready.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"net/http"

"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
)

type ClientReady struct {
Expand Down
6 changes: 3 additions & 3 deletions libgm/events/ready_test.go → pkg/libgm/events/ready_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"go.mau.fi/mautrix-gmessages/libgm/events"
"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/libgm/pblite"
"go.mau.fi/mautrix-gmessages/pkg/libgm/events"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm/pblite"
)

func TestRequestError_Is(t *testing.T) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions libgm/gmtest/main.go → pkg/libgm/gmtest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (

"github.com/rs/zerolog"

"go.mau.fi/mautrix-gmessages/libgm"
"go.mau.fi/mautrix-gmessages/libgm/events"
"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm"
"go.mau.fi/mautrix-gmessages/pkg/libgm/events"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
)

func must(err error) {
Expand Down
8 changes: 4 additions & 4 deletions libgm/http.go → pkg/libgm/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
"github.com/rs/zerolog"
"google.golang.org/protobuf/proto"

"go.mau.fi/mautrix-gmessages/libgm/events"
"go.mau.fi/mautrix-gmessages/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/libgm/pblite"
"go.mau.fi/mautrix-gmessages/libgm/util"
"go.mau.fi/mautrix-gmessages/pkg/libgm/events"
"go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto"
"go.mau.fi/mautrix-gmessages/pkg/libgm/pblite"
"go.mau.fi/mautrix-gmessages/pkg/libgm/util"
)

const ContentTypeProtobuf = "application/x-protobuf"
Expand Down
Loading

0 comments on commit 96b2192

Please sign in to comment.