dependency_manager

package
v0.0.83 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultModuleDependenciesTableName    = "terrarium-module-dependencies"
	DefaultContainerDependenciesTableName = "terrarium-container-dependencies"
	DefaultDependencyManagerEndpoint      = "dependency_manager:3001"
)

Variables

View Source
var (
	ModuleDependenciesTableName    = DefaultModuleDependenciesTableName
	ContainerDependenciesTableName = DefaultContainerDependenciesTableName
	DependencyManagerEndpoint      = DefaultDependencyManagerEndpoint

	ModuleDependenciesRegistered    = &terrarium.Response{Message: "Module dependencies successfully registered."}
	ContainerDependenciesRegistered = &terrarium.Response{Message: "Container dependencies successfully registered."}

	ModuleDependenciesTableInitializationError    = status.Error(codes.Unavailable, "Failed to initialize table for module dependencies.")
	ContainerDependenciesTableInitializationError = status.Error(codes.Unavailable, "Failed to initialize table for container dependencies.")
	RegisterDependenciesError                     = status.Error(codes.Unknown, "Failed to register dependencies.")
	MarshalDependenciesError                      = status.Error(codes.Unknown, "Failed to marshal dependencies.")
	SendModuleDependenciesError                   = status.Error(codes.Unknown, "Failed to send module dependencies.")
	SendContainerDependenciesError                = status.Error(codes.Unknown, "Failed to send container dependencies.")
	UnmarshalModuleDependenciesError              = status.Error(codes.Unknown, "Failed to unmarshal module dependencies.")
	UnmarshalContainerDependenciesError           = status.Error(codes.Unknown, "Failed to unmarshal container dependencies.")
	GetModuleDependenciesError                    = status.Error(codes.Unknown, "Failed to get module dependencies.")
	GetContainerDependenciesError                 = status.Error(codes.Unknown, "Failed to get container dependencies.")
)

Functions

func GetDependenciesSchema

func GetDependenciesSchema(table string) *dynamodb.CreateTableInput

GetDependenciesSchema returns CreateTableInput that can be used to create table if it does not exist

func NewDependencyManagerGrpcClient added in v0.0.70

func NewDependencyManagerGrpcClient(endpoint string) services.DependencyManagerClient

Types

type ContainerDependencies

type ContainerDependencies struct {
	Name    string                                      `json:"name" bson:"name" dynamodbav:"name"`
	Version string                                      `json:"version" bson:"version" dynamodbav:"version"`
	Images  map[string]*terrarium.ContainerImageDetails `json:"images" bson:"images" dynamodbav:"images"`
}

type DependencyManagerService

type DependencyManagerService struct {
	services.UnimplementedDependencyManagerServer
	Db              storage.DynamoDBTableCreator
	ModuleTable     string
	ModuleSchema    *dynamodb.CreateTableInput
	ContainerTable  string
	ContainerSchema *dynamodb.CreateTableInput
}

func (*DependencyManagerService) GetContainerDependencies

func (s *DependencyManagerService) GetContainerDependencies(ctx context.Context, module *terrarium.Module) (map[string]*terrarium.ContainerImageDetails, error)

func (*DependencyManagerService) GetModuleDependencies

func (s *DependencyManagerService) GetModuleDependencies(ctx context.Context, module *terrarium.Module) ([]*terrarium.Module, error)

func (*DependencyManagerService) GetModuleKey

func (s *DependencyManagerService) GetModuleKey(module *terrarium.Module) (map[string]types.AttributeValue, error)

func (*DependencyManagerService) RegisterContainerDependencies

RegisterContainerDependencies Registers Container dependencies in Terrarium

func (*DependencyManagerService) RegisterModuleDependencies

Registers Module dependencies in Terrarium

func (*DependencyManagerService) RegisterWithServer

func (s *DependencyManagerService) RegisterWithServer(grpcServer grpc.ServiceRegistrar) error

RegisterWithServer Registers DependencyManagerService with grpc server

func (*DependencyManagerService) RetrieveContainerDependencies

RetrieveContainerDependencies Retrieve Container dependencies from Terrarium

func (*DependencyManagerService) RetrieveModuleDependencies

RetrieveModuleDependencies Retrieve Module dependencies from Terrarium

type ModuleDependencies

type ModuleDependencies struct {
	Name    string              `json:"name" bson:"name" dynamodbav:"name"`
	Version string              `json:"version" bson:"version" dynamodbav:"version"`
	Modules []*terrarium.Module `json:"modules" bson:"modules" dynamodbav:"modules"`
}

Jump to

Keyboard shortcuts

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