Skip to content

Instantly share code, notes, and snippets.

View vedashree29296's full-sized avatar

Vedashree Patil vedashree29296

View GitHub Profile
@vedashree29296
vedashree29296 / Dockerfile
Created June 8, 2020 10:56
Dockerfile to create custom image for seabolt on AWS Lambda
FROM lambci/lambda-base:build
RUN yum makecache fast; yum clean all && yum -y update && yum -y upgrade; yum clean all && \
yum install -y yum-plugin-ovl; yum clean all && yum -y groupinstall "Development Tools"; yum clean all
RUN yum -y install gcc gcc-c++ make pkgconfig wget
RUN openssl version -a
RUN wget https://github.com/neo4j-drivers/seabolt/releases/download/v1.7.4/seabolt-1.7.4-Linux-centos-7.tar.gz
RUN tar zxvf seabolt-1.7.4-Linux-centos-7.tar.gz --strip-components=1 -C /
RUN mkdir -p /opt/lib
@vedashree29296
vedashree29296 / create_layer.sh
Created June 8, 2020 11:07
package dependencies for lambda
# create a directory
mkdir -p layer
# build the image
docker build -t seabolt-base .
# copy the contents to the layer directory
CONTAINER=$(docker run -d seabolt-base false)
docker cp $CONTAINER:/opt/lib ./layer
docker rm $CONTAINER
@vedashree29296
vedashree29296 / serverless.yml
Last active June 8, 2020 11:25
Yaml file to create seabolt layer in AWS Lambda
service: neo4j-lambda-connector # update this with your service name
frameworkVersion: ">=1.28.0 <2.0.0"
# provide appropriate values
provider:
name: aws
runtime: go1.x
stage: dev
@vedashree29296
vedashree29296 / petstore-oas-simple-v1.yaml
Created January 25, 2021 10:35
Open API specification for pet store in Go Chronicles Microservices series
openapi: 3.0.0
info:
version: "1.0.0"
title: Pet Adoption Store
description: Server for Pet Adoption
paths:
"/category":
post:
tags:
@vedashree29296
vedashree29296 / oas-header.yaml
Last active January 25, 2021 10:42
OpenAPI spec header
openapi: 3.0.1 # Open API version
info: # General information
title: Pet Adoption
version: 1.0.0
description: API for Go Chronicles microservice series
tags:
- name: Pet
description: Add and list Pets
# all services will be
# defined under "paths"
@vedashree29296
vedashree29296 / oas-schema-example.yaml
Last active January 25, 2021 10:48
Example to write a schema in OAS
components: # define schemas under this section
schemas:
Category: # create a category schema
description: Category of pets
type: object # this can correspond to a JSON object
properties: # define the properties in the object
id:
type: integer # define the type of object
example: 1 # give an example for better documentation
categoryName:
@vedashree29296
vedashree29296 / petstore-oas-post-simple-v1.yaml
Last active January 25, 2021 10:59
Example for POST call
paths: # all routes go under this
"/pet":
post: # define the type ie get/post/put/delete
tags:
- Pet
summary: Add a new pet to the store
requestBody: # define the request body under this
content:
application/json: # this shows that the request body is a JSON object
schema:
paths:
"/pet":
get:
parameters:
- in: query # defines the query parameter that should be sent which is the category id
name: categoryId
schema:
type: integer
example: 1
required: true
@vedashree29296
vedashree29296 / petstore-db-v1.sql
Created January 26, 2021 06:11
database sql file for petstore app in Go Chronicles
CREATE TABLE "category" (
"id" int PRIMARY KEY,
"category_name" varchar
);
CREATE TABLE "breed" (
"id" int,
"breed_name" varchar,
"category_id" int,
PRIMARY KEY ("id", "category_id")
@vedashree29296
vedashree29296 / postgres-init.go
Created January 29, 2021 08:47
Connecting to Postgres
package postgres
import (
"database/sql"
"fmt"
//for connecting to db
_ "github.com/lib/pq"
)
const (