Documentation ¶
Index ¶
- Constants
- Variables
- func GetModulesSchema(table string) *dynamodb.CreateTableInput
- type Module
- type RegistrarService
- func (s *RegistrarService) GetModule(ctx context.Context, request *services.GetModuleRequest) (*services.GetModuleResponse, error)
- func (s *RegistrarService) ListModules(ctx context.Context, request *services.ListModulesRequest) (*services.ListModulesResponse, error)
- func (s *RegistrarService) Register(ctx context.Context, request *terrarium.RegisterModuleRequest) (*terrarium.Response, error)
- func (s *RegistrarService) RegisterWithServer(grpcServer grpc.ServiceRegistrar) error
Constants ¶
View Source
const ( DefaultRegistrarTableName = "terrarium-modules" DefaultRegistrarServiceEndpoint = "registrar:3001" )
Variables ¶
View Source
var ( RegistrarTableName = DefaultRegistrarTableName RegistrarServiceEndpoint = DefaultRegistrarServiceEndpoint ModuleRegistered = &terrarium.Response{Message: "Module registered successfully."} ModuleTableInitializationError = status.Error(codes.Unknown, "Failed to initialize table for modules.") ModuleGetError = status.Error(codes.Unknown, "Failed to check if module already exists.") ModuleUpdateError = status.Error(codes.Unknown, "Failed to update module.") ModuleRegisterError = status.Error(codes.Unknown, "Failed to register module.") ExpressionBuildError = status.Error(codes.Unknown, "Failed to build update expression.") MarshalModuleError = status.Error(codes.Unknown, "Failed to marshal module.") )
Functions ¶
func GetModulesSchema ¶
func GetModulesSchema(table string) *dynamodb.CreateTableInput
GetModulesSchema returns CreateTableInput that can be used to create table if it does not exist
Types ¶
type Module ¶
type Module struct { Name string `json:"name" bson:"name" dynamodbav:"name"` Description string `json:"description" bson:"description" dynamodbav:"description"` Source string `json:"source_url" bson:"source_url" dynamodbav:"source"` Maturity string `json:"maturity" bson:"maturity" dynamodbav:"maturity"` CreatedOn string `json:"created_on" bson:"created_on" dynamodbav:"created_on"` ModifiedOn string `json:"modified_on" bson:"modified_on" dynamodbav:"modified_on"` }
type RegistrarService ¶
type RegistrarService struct { services.UnimplementedRegistrarServer Db storage.DynamoDBTableCreator Table string Schema *dynamodb.CreateTableInput }
func (*RegistrarService) GetModule ¶
func (s *RegistrarService) GetModule(ctx context.Context, request *services.GetModuleRequest) (*services.GetModuleResponse, error)
GetModule Retrieve module metadata
func (*RegistrarService) ListModules ¶
func (s *RegistrarService) ListModules(ctx context.Context, request *services.ListModulesRequest) (*services.ListModulesResponse, error)
ListModules Retrieve all published modules
func (*RegistrarService) Register ¶
func (s *RegistrarService) Register(ctx context.Context, request *terrarium.RegisterModuleRequest) (*terrarium.Response, error)
Register new Module in Terrarium
func (*RegistrarService) RegisterWithServer ¶
func (s *RegistrarService) RegisterWithServer(grpcServer grpc.ServiceRegistrar) error
Registers RegistrarService with grpc server
Click to show internal directories.
Click to hide internal directories.