edp

package
v0.0.0-...-f7d1ac2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaasConsumerEnvironmentKey = "maasConsumerEnvironment"
	MaasConsumerRegionKey      = "maasConsumerRegion"
	MaasConsumerSubAccountKey  = "maasConsumerSubAccount"
	MaasConsumerServicePlan    = "maasConsumerServicePlan"
)

Variables

This section is empty.

Functions

func IsConflictError

func IsConflictError(err error) bool

func NewEDPBadRequestError

func NewEDPBadRequestError(id string, format string, args ...interface{}) kebError.ErrorReporter

func NewEDPConflictError

func NewEDPConflictError(id string, format string, args ...interface{}) kebError.ErrorReporter

func NewEDPNotFoundError

func NewEDPNotFoundError(id string, format string, args ...interface{}) kebError.ErrorReporter

func NewEDPOtherError

func NewEDPOtherError(id string, code int, format string, args ...interface{}) kebError.ErrorReporter

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config Config, log logrus.FieldLogger) *Client

func (*Client) CreateDataTenant

func (c *Client) CreateDataTenant(data DataTenantPayload) error

func (*Client) CreateMetadataTenant

func (c *Client) CreateMetadataTenant(name, env string, data MetadataTenantPayload) error

func (*Client) DeleteDataTenant

func (c *Client) DeleteDataTenant(name, env string) (err error)

func (*Client) DeleteMetadataTenant

func (c *Client) DeleteMetadataTenant(name, env, key string) (err error)

func (*Client) GetMetadataTenant

func (c *Client) GetMetadataTenant(name, env string) (_ []MetadataItem, err error)

type Config

type Config struct {
	AuthURL     string
	AdminURL    string
	Namespace   string
	Secret      string
	Environment string `envconfig:"default=prod"`
	Required    bool   `envconfig:"default=false"`
	Disabled    bool
}

type DataTenantItem

type DataTenantItem struct {
	Namespace   NamespaceItem `json:"namespace"`
	Name        string        `json:"name"`
	Environment string        `json:"environment"`
}

type DataTenantPayload

type DataTenantPayload struct {
	Name        string `json:"name"`
	Environment string `json:"environment"`
	Secret      string `json:"secret"`
}

type EDPErrReason

type EDPErrReason = kebError.ErrReason
const (
	ErrEDPConflict   EDPErrReason = "err_edp_internal"
	ErrEDPNotFound   EDPErrReason = "err_edp_not_found"
	ErrEDPBadRequest EDPErrReason = "err_edp_bad_request"
	ErrEDPTimeout    EDPErrReason = "err_edp_timeout"
	ErrEDPOther      EDPErrReason = "err_edp_other"
)

type FakeClient

type FakeClient struct {
	// contains filtered or unexported fields
}

FakeClient implements the edp client interface but does not process data nor call real external system

func NewFakeClient

func NewFakeClient() *FakeClient

NewFakeClient creates edp fake client

func (*FakeClient) CreateDataTenant

func (f *FakeClient) CreateDataTenant(data DataTenantPayload) error

func (*FakeClient) CreateMetadataTenant

func (f *FakeClient) CreateMetadataTenant(name, env string, data MetadataTenantPayload) error

func (*FakeClient) DeleteDataTenant

func (f *FakeClient) DeleteDataTenant(name, env string) error

func (*FakeClient) DeleteMetadataTenant

func (f *FakeClient) DeleteMetadataTenant(name, env, key string) error

func (*FakeClient) GetDataTenantItem

func (f *FakeClient) GetDataTenantItem(name, env string) (item DataTenantItem, exists bool)

assert methods

func (*FakeClient) GetMetadataItem

func (f *FakeClient) GetMetadataItem(name, env, key string) (item MetadataItem, exists bool)

type MetadataItem

type MetadataItem struct {
	DataTenant DataTenantItem `json:"dataTenant"`
	Key        string         `json:"key"`
	Value      string         `json:"value"`
}

type MetadataTenantPayload

type MetadataTenantPayload struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type NamespaceItem

type NamespaceItem struct {
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL