registry

package
v0.0.0-...-c8bc4d7 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownHostCode = "11097"
)

Functions

func ErrUnknownHost

func ErrUnknownHost(err error) error

func HostnameToPascalCase

func HostnameToPascalCase(input string) string

Types

type ArtifactHub

type ArtifactHub struct{}

func (ArtifactHub) HandleDependents

func (ah ArtifactHub) HandleDependents(comp v1alpha1.Component, kc *kubernetes.Client, isDeploy bool) (summary string, err error)

func (ArtifactHub) String

func (ah ArtifactHub) String() string

type Entity

type Entity interface {
	Type() types.CapabilityType
	GetID() uuid.UUID
}

Entity is referred as any type of schema managed by the registry ComponentDefinitions and PolicyDefinitions are examples of entities

type Host

type Host struct {
	ID        uuid.UUID `json:"-"`
	Hostname  string
	Port      int
	Metadata  string
	CreatedAt time.Time `json:"-"`
	UpdatedAt time.Time `json:"-"`
	IHost     IHost     `gorm:"-"`
}

func (*Host) AfterFind

func (h *Host) AfterFind(tx *gorm.DB) error

type IHost

type IHost interface {
	HandleDependents(comp v1alpha1.Component, kc *kubernetes.Client, isDeploy bool) (string, error)
	String() string
}

Each host from where meshmodels can be generated needs to implement this interface HandleDependents, contains host specific logic for provisioning required CRDs/operators for corresponding components.

type Kubernetes

type Kubernetes struct{}

func (Kubernetes) HandleDependents

func (k Kubernetes) HandleDependents(comp v1alpha1.Component, kc *kubernetes.Client, isDeploy bool) (summary string, err error)

func (Kubernetes) String

func (k Kubernetes) String() string

type MeshModelRegistrantData

type MeshModelRegistrantData struct {
	Host       Host                 `json:"host"`
	EntityType types.CapabilityType `json:"entityType"`
	Entity     []byte               `json:"entity"` //This will be type converted to appropriate entity on server based on passed entity type
}

MeshModelRegistrantData struct defines the body of the POST request that is sent to the capability registry (Meshplay)

The body contains the 1. Host information 2. Entity type 3. Entity

type Registry

type Registry struct {
	ID           uuid.UUID
	RegistrantID uuid.UUID
	Entity       uuid.UUID
	Type         types.CapabilityType
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

type RegistryManager

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

RegistryManager instance will expose methods for registry operations & sits between the database level operations and user facing API handlers.

func NewRegistryManager

func NewRegistryManager(db *database.Handler) (*RegistryManager, error)

NewRegistryManager initializes the registry manager by creating appropriate tables. Any new entities that are added to the registry should be migrated here into the database

func (*RegistryManager) Cleanup

func (rm *RegistryManager) Cleanup()

func (*RegistryManager) GetCategories

func (rm *RegistryManager) GetCategories(db *database.Handler, f types.Filter) ([]v1alpha1.Category, int64)

func (*RegistryManager) GetEntities

func (rm *RegistryManager) GetEntities(f types.Filter) ([]Entity, *int64, *int)

func (*RegistryManager) GetModels

func (rm *RegistryManager) GetModels(db *database.Handler, f types.Filter) ([]v1alpha1.Model, int64, int)

func (*RegistryManager) GetRegistrant

func (rm *RegistryManager) GetRegistrant(e Entity) Host

func (*RegistryManager) GetRegistrants

func (*RegistryManager) RegisterEntity

func (rm *RegistryManager) RegisterEntity(h Host, en Entity) error

Jump to

Keyboard shortcuts

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