This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "txp/restapistarter/app" | |
| func main() { | |
| app := new(app.App) | |
| app.InitComponents() | |
| app.Run() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Injectable } from "@nestjs/common"; | |
| import { CreateAppDto } from "./create-app.dto"; | |
| import { App } from "./data/entities/app.entity"; | |
| import { v4 as uuidv4 } from 'uuid'; | |
| import { DbDataOpsInstance } from "./libs/dynamodb"; | |
| import { DeleteCommandInput, GetCommandInput, PutCommand, PutCommandInput, ScanCommandInput, UpdateCommandInput } from "@aws-sdk/lib-dynamodb"; | |
| import { Constants } from "./constants"; | |
| import { DbClientsProvider } from "./data/db-clients.provider"; | |
| @Injectable() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { DynamoDBClient } from "@aws-sdk/client-dynamodb"; | |
| import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb"; | |
| import { Injectable } from "@nestjs/common"; | |
| @Injectable() | |
| export class DbClientsProvider { | |
| public dbClient: DynamoDBClient; | |
| public dbDocumentClient: DynamoDBDocumentClient | |
| constructor() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { CreateTableInput } from "@aws-sdk/client-dynamodb"; | |
| import { Constants } from "../../constants"; | |
| import { DbControlOpsInstance } from "../../libs/dynamodb"; | |
| const appTableParams: CreateTableInput = { | |
| TableName: "Apps", | |
| KeySchema: [ | |
| { | |
| AttributeName: "id", | |
| KeyType: "HASH" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Injectable } from '@nestjs/common'; | |
| import { AppRepository } from './app.repository'; | |
| import { CreateAppDto } from './create-app.dto'; | |
| @Injectable() | |
| export class AppService { | |
| constructor( | |
| private readonly repository: AppRepository | |
| ) { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Injectable } from "@nestjs/common"; | |
| import { CreateAppDto } from "./create-app.dto"; | |
| import { App } from "./data/entities/app.entity"; | |
| import { v4 as uuidv4 } from 'uuid'; | |
| import { DbDataOpsInstance } from "./libs/dynamodb"; | |
| import { DeleteCommandInput, GetCommandInput, PutCommandInput, ScanCommandInput, UpdateCommandInput } from "@aws-sdk/lib-dynamodb"; | |
| import { Constants } from "./constants"; | |
| @Injectable() | |
| export class AppRepository { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { CreateTableCommand, CreateTableInput, DeleteTableCommand, DeleteTableInput, DescribeTableCommand, DescribeTableInput, ListTablesCommand, UpdateTableCommand, UpdateTableInput } from "@aws-sdk/client-dynamodb"; | |
| import { Logger } from "@nestjs/common"; | |
| import { DbClientsInstance } from "./db.clients"; | |
| class DbControlOps { | |
| private static instance: DbControlOps; | |
| private constructor() { | |
| console.log('DbControlOps init'); | |
| if(DbControlOps.instance) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { BatchExecuteStatementCommand, BatchExecuteStatementCommandInput, BatchGetCommand, BatchGetCommandInput, DeleteCommand, DeleteCommandInput, ExecuteStatementCommand, ExecuteStatementCommandInput, ExecuteTransactionCommand, ExecuteTransactionCommandInput, GetCommand, GetCommandInput, PutCommand, PutCommandInput, QueryCommand, QueryCommandInput, ScanCommand, ScanCommandInput, UpdateCommand, UpdateCommandInput } from "@aws-sdk/lib-dynamodb"; | |
| import { Logger } from "@nestjs/common"; | |
| import { DbClientsInstance } from "./db.clients"; | |
| class DbDataOps { | |
| private static instance: DbDataOps; | |
| private constructor() { | |
| console.log('DbDataOps init'); | |
| if(DbDataOps.instance) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { DynamoDBClient } from "@aws-sdk/client-dynamodb"; | |
| import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb"; | |
| class DbClients { | |
| private static instance: DbClients; | |
| public dbClient: DynamoDBClient; | |
| public dbDocumentClient: DynamoDBDocumentClient | |
| private constructor() { | |
| console.log('DbClients init'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package app | |
| import ( | |
| "io" | |
| "net/http" | |
| "os" | |
| "path/filepath" | |
| ) | |
| // FileSave fetches the file and saves to disk |
NewerOlder