Skip to content

Commit

Permalink
Merge branch 'master' into feat/BUX-434/ChangeReadme
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazarii-4chain authored Jan 16, 2024
2 parents 9c979af + 496abed commit 0925021
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 2,232 deletions.
373 changes: 139 additions & 234 deletions buxclient_test.go

Large diffs are not rendered by default.

18 changes: 0 additions & 18 deletions client_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ func WithHTTP(serverURL string) ClientOps {
}
}

// WithGraphQL will overwrite the default client with a custom client
func WithGraphQL(serverURL string) ClientOps {
return func(c *BuxClient) {
if c != nil {
c.transportOptions = append(c.transportOptions, transports.WithGraphQL(serverURL))
}
}
}

// WithHTTPClient will overwrite the default client with a custom client
func WithHTTPClient(serverURL string, httpClient *http.Client) ClientOps {
return func(c *BuxClient) {
Expand All @@ -60,15 +51,6 @@ func WithHTTPClient(serverURL string, httpClient *http.Client) ClientOps {
}
}

// WithGraphQLClient will overwrite the default client with a custom client
func WithGraphQLClient(serverURL string, httpClient *http.Client) ClientOps {
return func(c *BuxClient) {
if c != nil {
c.transportOptions = append(c.transportOptions, transports.WithGraphQLClient(serverURL, httpClient))
}
}
}

// WithAdminKey will set the admin key for admin requests
func WithAdminKey(adminKey string) ClientOps {
return func(c *BuxClient) {
Expand Down
19 changes: 0 additions & 19 deletions examples/graphql/graphql.go

This file was deleted.

2 changes: 0 additions & 2 deletions go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 0 additions & 34 deletions transports/client_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,6 @@ func WithAccessKey(accessKey *bec.PrivateKey) ClientOps {
}
}

// WithGraphQL will overwrite the default client with a custom client
func WithGraphQL(serverURL string) ClientOps {
return func(c *Client) {
if c != nil {
c.transport = NewTransportService(&TransportGraphQL{
server: serverURL,
signRequest: c.signRequest,
adminXPriv: c.adminXPriv,
httpClient: &http.Client{},
xPriv: c.xPriv,
xPub: c.xPub,
accessKey: c.accessKey,
})
}
}
}

// WithHTTP will overwrite the default client with a custom client
func WithHTTP(serverURL string) ClientOps {
return func(c *Client) {
Expand All @@ -68,23 +51,6 @@ func WithHTTP(serverURL string) ClientOps {
}
}

// WithGraphQLClient will overwrite the default client with a custom client
func WithGraphQLClient(serverURL string, httpClient *http.Client) ClientOps {
return func(c *Client) {
if c != nil {
c.transport = NewTransportService(&TransportGraphQL{
server: serverURL,
signRequest: c.signRequest,
adminXPriv: c.adminXPriv,
httpClient: httpClient,
xPriv: c.xPriv,
xPub: c.xPub,
accessKey: c.accessKey,
})
}
}
}

// WithHTTPClient will overwrite the default client with a custom client
func WithHTTPClient(serverURL string, httpClient *http.Client) ClientOps {
return func(c *Client) {
Expand Down
5 changes: 1 addition & 4 deletions transports/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package transports

import buxmodels "github.com/BuxOrg/bux-models"

// TransportType the type of transport being used (http or graphql)
// TransportType the type of transport being used ('http' for usage or 'mock' for testing)
type TransportType string

// BuxUserAgent the bux user agent sent to the bux server
Expand All @@ -15,9 +15,6 @@ const (
// BuxTransportHTTP uses the http transport for all bux server actions
BuxTransportHTTP TransportType = "http"

// BuxTransportGraphQL uses the graphql transport for all bux server actions
BuxTransportGraphQL TransportType = "graphql"

// BuxTransportMock uses the mock transport for all bux server actions
BuxTransportMock TransportType = "mock"
)
Expand Down
Loading

0 comments on commit 0925021

Please sign in to comment.