Skip to content

Commit

Permalink
Notifications (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpanayotov authored and dzahariev committed May 10, 2019
1 parent 33981ad commit 4c38556
Show file tree
Hide file tree
Showing 36 changed files with 3,807 additions and 757 deletions.
104 changes: 60 additions & 44 deletions Gopkg.lock

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

20 changes: 18 additions & 2 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

[[constraint]]
name = "github.com/sirupsen/logrus"
version = "=1.0.4"
version = "=1.4.1"

[[constraint]]
name = "github.com/onsi/ginkgo"
Expand All @@ -43,7 +43,7 @@

[[constraint]]
name = "github.com/Peripli/service-manager"
version = "=0.2.3"
version = "=0.3.0"

# Refer to issue https://github.com/golang/dep/issues/1799
[[override]]
Expand All @@ -53,3 +53,19 @@
[[constraint]]
name = "github.com/patrickmn/go-cache"
version = "2.1.0"

[[constraint]]
name = "github.com/gorilla/websocket"
version = "1.4.0"

[[constraint]]
name = "github.com/tidwall/gjson"
version = "v1.1.3"

[[constraint]]
name = "github.com/tidwall/sjson"
version = "v1.0.3"

[[constraint]]
name = "github.com/gofrs/uuid"
version = "=3.1.0"
43 changes: 42 additions & 1 deletion pkg/platform/broker_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,55 @@

package platform

import "context"
import (
"context"
"encoding/json"

"github.com/Peripli/service-manager/pkg/types"
)

// CreateServiceBrokerRequest type used for requests by the platform client
type CreateServiceBrokerRequest struct {
Name string `json:"name"`
BrokerURL string `json:"broker_url"`
}

// UpdateServiceBrokerRequest type used for requests by the platform client
type UpdateServiceBrokerRequest struct {
GUID string `json:"guid"`
Name string `json:"name"`
BrokerURL string `json:"broker_url"`
}

// DeleteServiceBrokerRequest type used for requests by the platform client
type DeleteServiceBrokerRequest struct {
GUID string `json:"guid"`
Name string `json:"name"`
}

// ServiceBroker type for responses from the platform client
type ServiceBroker struct {
GUID string `json:"guid"`
Name string `json:"name"`
BrokerURL string `json:"broker_url"`
ServiceOfferings []types.ServiceOffering `json:"services"`
Metadata map[string]json.RawMessage `json:"metadata"`
}

// ServiceBrokerList type for responses from the platform client
type ServiceBrokerList struct {
ServiceBrokers []ServiceBroker `json:"service_brokers"`
}

// BrokerClient provides the logic for calling into the underlying platform and performing platform specific operations
//go:generate counterfeiter . BrokerClient
type BrokerClient interface {
// GetBrokers obtains the registered brokers in the platform
GetBrokers(ctx context.Context) ([]ServiceBroker, error)

// GetBrokerByName returns the broker from the platform with the specified name
GetBrokerByName(ctx context.Context, name string) (*ServiceBroker, error)

// CreateBroker registers a new broker at the platform
CreateBroker(ctx context.Context, r *CreateServiceBrokerRequest) (*ServiceBroker, error)

Expand Down
Loading

0 comments on commit 4c38556

Please sign in to comment.