service

package
v0.0.0-...-3e5e6b6 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAppLabeler

func NewAppLabeler() *labeler

func NewConverter

func NewConverter() *converter

func NewRequestContextProvider

func NewRequestContextProvider() *requestContextProvider

Types

type AppLabeler

type AppLabeler interface {
	WriteServiceReference(appLabels graphql.Labels, serviceReference LegacyServiceReference) (graphql.LabelInput, error)
	DeleteServiceReference(appLabels graphql.Labels, serviceID string) (graphql.LabelInput, error)
	ReadServiceReference(appLabels graphql.Labels, serviceID string) (LegacyServiceReference, error)
	ListServiceReferences(appLabels graphql.Labels) ([]LegacyServiceReference, error)
}

type Converter

type Converter interface {
	DetailsToGraphQLCreateInput(deprecated model.ServiceDetails) (graphql.BundleCreateInput, error)
	GraphQLCreateInputToUpdateInput(in graphql.BundleCreateInput) graphql.BundleUpdateInput
	GraphQLToServiceDetails(converted graphql.BundleExt, legacyServiceReference LegacyServiceReference) (model.ServiceDetails, error)
	ServiceDetailsToService(in model.ServiceDetails, serviceID string) (model.Service, error)
}

type DirectorClient

type DirectorClient interface {
	CreateBundle(ctx context.Context, appID string, in graphql.BundleCreateInput) (string, error)
	GetBundle(ctx context.Context, appID string, bundleID string) (graphql.BundleExt, error)
	ListBundles(ctx context.Context, appID string) ([]*graphql.BundleExt, error)
	DeleteBundle(ctx context.Context, bundleID string) error
	UpdateBundle(ctx context.Context, bundleID string, in graphql.BundleUpdateInput) error

	CreateAPIDefinition(ctx context.Context, bundleID string, apiDefinitionInput graphql.APIDefinitionInput) (string, error)
	CreateEventDefinition(ctx context.Context, bundleID string, eventDefinitionInput graphql.EventDefinitionInput) (string, error)
	CreateDocument(ctx context.Context, bundleID string, documentInput graphql.DocumentInput) (string, error)
	DeleteAPIDefinition(ctx context.Context, apiID string) error
	DeleteEventDefinition(ctx context.Context, eventID string) error
	DeleteDocument(ctx context.Context, documentID string) error

	SetApplicationLabel(ctx context.Context, appID string, label graphql.LabelInput) error
}

type Handler

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

func NewHandler

func NewHandler(converter Converter, validator Validator, reqContextProvider RequestContextProvider, appLabeler AppLabeler) *Handler

func (*Handler) Create

func (h *Handler) Create(writer http.ResponseWriter, request *http.Request)

func (*Handler) Delete

func (h *Handler) Delete(writer http.ResponseWriter, request *http.Request)

func (*Handler) Get

func (h *Handler) Get(writer http.ResponseWriter, request *http.Request)

func (*Handler) List

func (h *Handler) List(writer http.ResponseWriter, request *http.Request)

func (*Handler) Update

func (h *Handler) Update(writer http.ResponseWriter, request *http.Request)

type LegacyServiceReference

type LegacyServiceReference struct {
	ID         string `json:"id"`
	Identifier string `json:"identifier"`
}

type RequestContext

type RequestContext struct {
	AppID          string
	AppLabels      graphql.Labels
	DirectorClient DirectorClient
}

type RequestContextProvider

type RequestContextProvider interface {
	ForRequest(r *http.Request) (RequestContext, error)
}

type SuccessfulCreateResponse

type SuccessfulCreateResponse struct {
	ID string `json:"id"`
}

type Validator

type Validator interface {
	Validate(details model.ServiceDetails) apperrors.AppError
}

Directories

Path Synopsis
* Copied from https://github.com/kyma-project/kyma/tree/main/components/application-registry
* Copied from https://github.com/kyma-project/kyma/tree/main/components/application-registry

Jump to

Keyboard shortcuts

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