This file contains 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
func (m *DynamodbMockClient) GetItem(input *dynamodb.GetItemInput) ( | |
*dynamodb.GetItemOutput, | |
error, | |
) { | |
var err = errors.New("player not found") | |
val, ok := input.Key["PlayerName"] | |
if ok { | |
err = nil | |
switch *val.S { |
This file contains 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 middleware | |
import ( | |
"fmt" | |
"aws-golang-lambda/pkg/jwtparser" | |
"github.com/gin-gonic/gin" | |
) |
This file contains 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 ( | |
"context" | |
"os" | |
"aws-golang-lambda/api/handler" | |
"aws-golang-lambda/usecase/users" | |
mysqldb "aws-golang-lambda/repository/mysql" |
This file contains 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 mysql | |
type Users struct { | |
Address string `db:"address"` | |
FirstName string `db:"first_name"` | |
LastName string `db:"last_name"` | |
Password string `db:"password"` | |
Username string `db:"username"` | |
} |
This file contains 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 ddb | |
import ( | |
"fmt" | |
"aws-golang-lambda/entity" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/service/dynamodb" | |
"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute" |
This file contains 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
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: A lambda to upload to S3 | |
Parameters: | |
Environment: | |
Type: String | |
AllowedValues: | |
- dev | |
- staging | |
- prod |
This file contains 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
#!/bin/bash | |
set -e | |
function cleanup { | |
echo "Cleaning up..." | |
rm -rf .pytest_cache __pycache__ *.pyc | |
} | |
ENV=$1 |
This file contains 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 json | |
import mock | |
import os | |
import pytest | |
import responses | |
import requests | |
from moto import mock_dynamodb2 |
This file contains 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 boto3 | |
import logging | |
import json | |
import os | |
import smart_open | |
import requests | |
from botocore.exceptions import ClientError, ParamValidationError |
This file contains 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
#!/bin/bash | |
aws dynamodb create-table \ | |
--table-name SanAntonioSpurs \ | |
--attribute-definitions AttributeName=PlayerName,AttributeType=S AttributeName=JerseyNumber,AttributeType=N \ | |
--key-schema AttributeName=PlayerName,KeyType=HASH AttributeName=JerseyNumber,KeyType=RANGE \ | |
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 | |
aws dynamodb put-item --table-name SanAntonioSpurs --item "{\"PlayerName\":{\"S\":\"Manu Ginobili\"},\"JerseyNumber\":{\"N\":\"20\"}, \"Position\":{\"S\":\"Shooting Guard\"}}" |