Skip to content

Commit

Permalink
Rename module to allow running go install
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-krieger committed Jan 14, 2025
1 parent fdf3d38 commit 0792aed
Show file tree
Hide file tree
Showing 68 changed files with 219 additions and 141 deletions.
3 changes: 2 additions & 1 deletion cmd/lib.go → cmd/rpc/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ import (
"encoding/csv"
"io"
"os"
"rpc/pkg/utils"
"strings"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"

log "github.com/sirupsen/logrus"
)

Expand Down
11 changes: 6 additions & 5 deletions cmd/main.go → cmd/rpc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ package main

import (
"os"
"rpc/internal/amt"
"rpc/internal/flags"
"rpc/internal/local"
"rpc/internal/rps"
"rpc/pkg/utils"

log "github.com/sirupsen/logrus"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/internal/amt"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/internal/flags"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/internal/local"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/internal/rps"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"
)

const AccessErrMsg = "Failed to execute due to access issues. " +
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module rpc
module github.com/open-amt-cloud-toolkit/rpc-go/v2

go 1.20

Expand Down
5 changes: 3 additions & 2 deletions internal/amt/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ package amt
import (
"errors"
"fmt"
"rpc/pkg/pthi"
"rpc/pkg/utils"
"strconv"
"strings"
"time"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/pthi"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"
)

//TODO: Ensure pointers are freed properly throughout this file
Expand Down
5 changes: 3 additions & 2 deletions internal/amt/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ package amt
import (
"errors"
"fmt"
"rpc/pkg/pthi"
"rpc/pkg/utils"
"testing"
"time"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/pthi"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"

"github.com/stretchr/testify/assert"
)

Expand Down
5 changes: 3 additions & 2 deletions internal/certs/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ import (
"encoding/hex"
"encoding/pem"
"fmt"
log "github.com/sirupsen/logrus"
"math/big"
"net"
"software.sslmate.com/src/go-pkcs12"
"strings"
"time"

log "github.com/sirupsen/logrus"
"software.sslmate.com/src/go-pkcs12"
)

type Composite struct {
Expand Down
3 changes: 2 additions & 1 deletion internal/certs/certs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
package certs

import (
"github.com/stretchr/testify/assert"
"strings"
"testing"

"github.com/stretchr/testify/assert"
)

func RunNewSignedCompositeTest(t *testing.T, testDer string) {
Expand Down
3 changes: 2 additions & 1 deletion internal/flags/activate.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import (
"fmt"
"reflect"
"regexp"
"rpc/pkg/utils"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"

log "github.com/sirupsen/logrus"
)
Expand Down
3 changes: 2 additions & 1 deletion internal/flags/activate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ package flags

import (
"os"
"rpc/pkg/utils"
"strings"
"testing"
"time"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"

"github.com/stretchr/testify/assert"
)

Expand Down
5 changes: 3 additions & 2 deletions internal/flags/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ import (
"fmt"
"os"
"path/filepath"
"rpc/internal/config"
"rpc/pkg/utils"
"strings"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/internal/config"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"

"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/wsman/cim/wifi"
"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/wsman/ips/ieee8021x"

Expand Down
5 changes: 3 additions & 2 deletions internal/flags/configure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ package flags
import (
"fmt"
"os"
"rpc/internal/config"
"rpc/pkg/utils"
"strings"
"testing"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/internal/config"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"

"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/wsman/cim/wifi"
"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/wsman/ips/ieee8021x"

Expand Down
3 changes: 2 additions & 1 deletion internal/flags/deactivate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ package flags

import (
"fmt"
"rpc/pkg/utils"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"
)

func (f *Flags) handleDeactivateCommand() error {
Expand Down
3 changes: 2 additions & 1 deletion internal/flags/deactivate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
package flags

import (
"rpc/pkg/utils"
"testing"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"

"github.com/stretchr/testify/assert"
)

Expand Down
9 changes: 5 additions & 4 deletions internal/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ import (
"net"
"os"
"path/filepath"
"rpc/internal/amt"
"rpc/internal/config"
"rpc/internal/smb"
"rpc/pkg/utils"
"strconv"
"strings"
"time"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/internal/amt"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/internal/config"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/internal/smb"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"

configv2 "github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/config"
"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/security"

Expand Down
9 changes: 5 additions & 4 deletions internal/flags/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ import (
"net"
"os"
"path/filepath"
"rpc/internal/config"
"rpc/internal/smb"
"rpc/pkg/pthi"
"rpc/pkg/utils"
"testing"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/internal/config"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/internal/smb"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/pthi"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"

"gopkg.in/yaml.v3"

"github.com/stretchr/testify/assert"
Expand Down
3 changes: 2 additions & 1 deletion internal/flags/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ package flags

import (
"flag"
"rpc/pkg/utils"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"
)

type AmtInfoFlags struct {
Expand Down
3 changes: 2 additions & 1 deletion internal/flags/info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
package flags

import (
"rpc/pkg/utils"
"strings"
"testing"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"

"github.com/stretchr/testify/assert"
)

Expand Down
5 changes: 3 additions & 2 deletions internal/flags/maintenance.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import (
"os"
"path/filepath"
"regexp"
"rpc/internal/amt"
"rpc/pkg/utils"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/internal/amt"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"

log "github.com/sirupsen/logrus"
)
Expand Down
3 changes: 2 additions & 1 deletion internal/flags/maintenance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ package flags
import (
"os"
"path/filepath"
"rpc/pkg/utils"
"strings"
"testing"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"

"github.com/stretchr/testify/assert"
)

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

import (
"rpc/pkg/utils"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"
)

func (f *Flags) handleVersionCommand() error {
Expand Down
6 changes: 4 additions & 2 deletions internal/lm/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ package lm
import (
"bytes"
"encoding/binary"
"rpc/pkg/pthi"
"sync"
"time"

"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/apf"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/pthi"

log "github.com/sirupsen/logrus"

"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/apf"
)

// LMConnection is struct for managing connection to LMS
Expand Down
6 changes: 4 additions & 2 deletions internal/lm/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ package lm

import (
"errors"
"rpc/pkg/pthi"
"sync"
"testing"

"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/apf"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/pthi"

"github.com/stretchr/testify/assert"

"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/apf"
)

type MockHECICommands struct{}
Expand Down
6 changes: 4 additions & 2 deletions internal/local/Certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ package local

import (
"reflect"
"rpc/pkg/utils"
"strings"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"

log "github.com/sirupsen/logrus"

"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/wsman/amt/publickey"
"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/wsman/amt/publicprivate"
"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/wsman/cim/concrete"
"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/wsman/cim/credential"
log "github.com/sirupsen/logrus"
)

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

import (
// "encoding/xml"
"rpc/internal/flags"
"rpc/pkg/utils"
"testing"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/internal/flags"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"

"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/wsman/amt/publickey"
"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/wsman/amt/publicprivate"

Expand Down
3 changes: 2 additions & 1 deletion internal/local/activate.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ import (
"encoding/hex"
"encoding/pem"
"errors"
"rpc/pkg/utils"
"strings"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"

log "github.com/sirupsen/logrus"
pkcs12 "software.sslmate.com/src/go-pkcs12"
)
Expand Down
9 changes: 5 additions & 4 deletions internal/local/activate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ package local

import (
"crypto/x509"
amt2 "rpc/internal/amt"
"rpc/internal/certs"
"rpc/internal/flags"
"rpc/pkg/utils"
"testing"

amt2 "github.com/open-amt-cloud-toolkit/rpc-go/v2/internal/amt"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/internal/certs"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/internal/flags"
"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"

"github.com/stretchr/testify/assert"
)

Expand Down
3 changes: 2 additions & 1 deletion internal/local/amt/localTransport.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import (
"fmt"
"io"
"net/http"
"rpc/internal/lm"
"sync"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/internal/lm"

"github.com/sirupsen/logrus"
)

Expand Down
6 changes: 4 additions & 2 deletions internal/local/amt/wsman.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ package amt
import (
"encoding/base64"
"net"
"rpc/pkg/utils"

"github.com/open-amt-cloud-toolkit/rpc-go/v2/pkg/utils"

"github.com/sirupsen/logrus"

"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/wsman"
"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/wsman/amt/authorization"
Expand All @@ -30,7 +33,6 @@ import (
"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/wsman/ips/hostbasedsetup"
"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/wsman/ips/ieee8021x"
"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/wsman/ips/optin"
"github.com/sirupsen/logrus"
)

type WSMANer interface {
Expand Down
Loading

0 comments on commit 0792aed

Please sign in to comment.