Skip to content

Commit

Permalink
Merge pull request #6 from liquidweb/api-prune
Browse files Browse the repository at this point in the history
changes to remove the api client that's no longer needed?
  • Loading branch information
jakdept committed Aug 31, 2023
2 parents add50b7 + 3ffabaf commit 412fdb2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ replace git.apache.org/thrift.git => github.com/apache/thrift v0.12.0
require (
github.com/BurntSushi/toml v0.3.1
github.com/hashicorp/terraform-plugin-sdk v1.17.2
github.com/liquidweb/go-lwApi v0.0.0-20190605172801-52a4864d2738
github.com/liquidweb/liquidweb-go v1.6.0
github.com/opentracing/opentracing-go v1.1.0
github.com/uber/jaeger-client-go v2.16.0+incompatible
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,6 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/liquidweb/go-lwApi v0.0.0-20190605172801-52a4864d2738 h1:5s07v4iHDpnXZiikAGltqdcCDUchV/LiwleQu2K2r/o=
github.com/liquidweb/go-lwApi v0.0.0-20190605172801-52a4864d2738/go.mod h1:0sYF9rMXb0vlG+4SzdiGMXHheCZxjguMq+Zb4S2BfBs=
github.com/liquidweb/liquidweb-go v1.6.0 h1:vIj1I/Wf97fUnyirD+bi6Y63c0GiXk9nKI1+sFFl3G0=
github.com/liquidweb/liquidweb-go v1.6.0/go.mod h1:UDcVnAMDkZxpw4Y7NOHkqoeiGacVLEIG/i5J9cyixzQ=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
Expand Down
24 changes: 10 additions & 14 deletions liquidweb/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ import (
"os"

"github.com/BurntSushi/toml"
lwapi "github.com/liquidweb/go-lwApi"
lwgoapi "github.com/liquidweb/liquidweb-go/client"
)

// Config holds all of the metadata for the provider and the Liquidweb API client.
type Config struct {
Client *lwapi.Client
LWAPI *lwgoapi.API
username string
password string
Expand All @@ -21,13 +19,12 @@ type Config struct {
}

// NewConfig accepts configuration parameters and returns a Config.
func NewConfig(username string, password string, url string, timeout int, client *lwapi.Client, nClient *lwgoapi.API) (*Config, error) {
func NewConfig(username string, password string, url string, timeout int, nClient *lwgoapi.API) (*Config, error) {
c := &Config{
username: username,
password: password,
URL: url,
Timeout: timeout,
Client: client,
LWAPI: nClient,
TracingEnabled: len(os.Getenv("TF_LOG")) > 0,
}
Expand Down Expand Up @@ -62,11 +59,11 @@ func GetConfig(path string) (interface{}, error) {
}
_ = metadata

config := lwapi.LWAPIConfig{
Username: &conf.LWAPI.Username,
Password: &conf.LWAPI.Password,
Url: conf.LWAPI.URL,
}
// config := lwapi.LWAPIConfig{
// Username: &conf.LWAPI.Username,
// Password: &conf.LWAPI.Password,
// Url: conf.LWAPI.URL,
// }

// vc := viper.New()
// vc.SetConfigFile(path)
Expand Down Expand Up @@ -94,10 +91,10 @@ func GetConfig(path string) (interface{}, error) {
// }

// Initialize original LW go client.
client, err := lwapi.New(&config)
if err != nil {
return nil, err
}
// client, err := lwapi.New(&config)
// if err != nil {
// return nil, err
// }

// Initial new LW go client.
lwAPI, err := lwgoapi.NewAPI(conf.LWAPI.Username, conf.LWAPI.Password, conf.LWAPI.URL, conf.LWAPI.Timeout)
Expand All @@ -110,7 +107,6 @@ func GetConfig(path string) (interface{}, error) {
conf.LWAPI.Password,
conf.LWAPI.URL,
conf.LWAPI.Timeout,
client,
lwAPI,
)
}

0 comments on commit 412fdb2

Please sign in to comment.