service

package
v0.0.0-...-4e1c9af Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatalogHandler

type CatalogHandler struct {
	PublicApi   outypes.CatalogueApi
	InternalApi intypes.InternalCatalogAPI
}

func NewCatalogHandler

func NewCatalogHandler() *CatalogHandler

func (*CatalogHandler) AddProviderVisibility

func (handler *CatalogHandler) AddProviderVisibility(c *gin.Context)

func (*CatalogHandler) GetProviderVisibility

func (handler *CatalogHandler) GetProviderVisibility(c *gin.Context)

func (*CatalogHandler) PubGetProviderInfo

func (handler *CatalogHandler) PubGetProviderInfo(c *gin.Context)

func (*CatalogHandler) PubSearch

func (handler *CatalogHandler) PubSearch(c *gin.Context)

func (*CatalogHandler) RegisterDataProvider

func (handler *CatalogHandler) RegisterDataProvider(c *gin.Context)

func (*CatalogHandler) RemoveProvider

func (handler *CatalogHandler) RemoveProvider(c *gin.Context)

func (*CatalogHandler) RemoveProviderVisibility

func (handler *CatalogHandler) RemoveProviderVisibility(c *gin.Context)

func (*CatalogHandler) SearchExistingProvider

func (handler *CatalogHandler) SearchExistingProvider(c *gin.Context)

func (*CatalogHandler) SetupInternalRoutes

func (handler *CatalogHandler) SetupInternalRoutes(router *gin.RouterGroup)

SetupInternalRoutes Define the (sub)routes handled by JSONDecoratorHandler

func (*CatalogHandler) SetupPublicRoutes

func (C *CatalogHandler) SetupPublicRoutes(router *gin.RouterGroup)

SetupPublicRoutes Define the (sub)routes handled by JSONDecoratorHandler

type CatalogMongoService

type CatalogMongoService struct {
	Database *mongo.Database
}

func NewCatalogMongoService

func NewCatalogMongoService() *CatalogMongoService

func (*CatalogMongoService) GetProvider

func (ms *CatalogMongoService) GetProvider(ctx context.Context, providerType outypes.ProviderType, ProviderId string) (ProviderInternalInfo, error)

func (*CatalogMongoService) InitCollections

func (ms *CatalogMongoService) InitCollections()

func (*CatalogMongoService) RemoveProvider

func (ms *CatalogMongoService) RemoveProvider(ctx context.Context, providerType outypes.ProviderType, providerId string) error

func (*CatalogMongoService) SaveDataProvider

func (ms *CatalogMongoService) SaveDataProvider(ctx context.Context, providerType outypes.ProviderType, provider ProviderInternalInfo) error

func (*CatalogMongoService) Search

func (ms *CatalogMongoService) Search(ctx context.Context, providerType outypes.ProviderType, searchTerms, originPeerName string) []outypes.ProviderInfo

func (*CatalogMongoService) SearchExistingProvider

func (*CatalogMongoService) UpdateVisibility

func (ms *CatalogMongoService) UpdateVisibility(ctx context.Context, providerType outypes.ProviderType, providerId string, visibility []string) error

type CatalogService

type CatalogService struct {
	MongoService ICatalogMongoService
}

func NewCatalogProvider

func NewCatalogProvider() *CatalogService

func (*CatalogService) AddProviderVisibility

func (cs *CatalogService) AddProviderVisibility(ctx context.Context, providerType outypes.ProviderType, ProviderId string, visibility []string) error

func (*CatalogService) GetProviderInfo

func (cs *CatalogService) GetProviderInfo(ctx context.Context, providerType outypes.ProviderType, ProviderId string) (outypes.ProviderInfo, error)

func (*CatalogService) GetProviderVisibility

func (cs *CatalogService) GetProviderVisibility(ctx context.Context, providerType outypes.ProviderType, ProviderId string) ([]string, error)

func (*CatalogService) RegisterDataProvider

func (cs *CatalogService) RegisterDataProvider(ctx context.Context, provider intypes.ProviderInternalInfo) error

func (*CatalogService) RemoveProvider

func (cs *CatalogService) RemoveProvider(ctx context.Context, providerType outypes.ProviderType, ProviderId string) error

func (*CatalogService) RemoveProviderVisibility

func (cs *CatalogService) RemoveProviderVisibility(ctx context.Context, providerType outypes.ProviderType, ProviderId string, visibility []string) error

func (*CatalogService) Search

func (cs *CatalogService) Search(ctx context.Context, providerType outypes.ProviderType, searchTerms, originPeer string) ([]outypes.ProviderInfo, error)

func (*CatalogService) SearchExistingProvider

func (cs *CatalogService) SearchExistingProvider(ctx context.Context, provider intypes.ProviderInternalInfo) (intypes.ProviderInternalInfo, error)

type ICatalogMongoService

type ICatalogMongoService interface {
	Search(ctx context.Context, providerType outypes.ProviderType, searchTerms, originPeerName string) []outypes.ProviderInfo
	GetProvider(ctx context.Context, providerType outypes.ProviderType, ProviderId string) (ProviderInternalInfo, error)
	SaveDataProvider(ctx context.Context, providerType outypes.ProviderType, provider ProviderInternalInfo) error
	UpdateVisibility(ctx context.Context, providerType outypes.ProviderType, providerId string, visibility []string) error
	RemoveProvider(ctx context.Context, providerType outypes.ProviderType, providerId string) error
}

type OriginID

type OriginID int
const (
	ORIGIN_UNKNOWN  OriginID = iota // Anonymous request. Not identified
	ORIGIN_LOCAL                    // Request from our own cluster
	ORIGIN_EXTERNAL                 // Request from other peer cluster
)

type ProviderInternalInfo

type ProviderInternalInfo struct {
	Id                primitive.ObjectID     `bson:"_id"`
	Visibility        []string               `bson:"visibility"`
	ProviderId        string                 `bson:"providerId"`
	Version           string                 `bson:"version"`
	Name              string                 `bson:"name"`
	Description       string                 `bson:"description"`
	Metadata          map[string]interface{} `bson:"metadata"`
	EndpointLocation  string                 `bson:"endpointLocation"`
	WorkflowStructure string                 `bson:"workflowStructure"`
}

func (*ProviderInternalInfo) FromInternalApi

func (sii *ProviderInternalInfo) FromInternalApi(i *intypes.ProviderInternalInfo)

func (*ProviderInternalInfo) ToInternalApi

func (sii *ProviderInternalInfo) ToInternalApi() *intypes.ProviderInternalInfo

func (*ProviderInternalInfo) ToPublicApi

func (sii *ProviderInternalInfo) ToPublicApi() *outypes.ProviderInfo

Jump to

Keyboard shortcuts

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