목록전체 글 (628)
반업주부의 일상 배움사

1. 파이썬(Python) 설치 https://www.python.org/downloads/ 2. 장고 설치 $ pip install django 3. 매니저 생성 (폴더가 새로 생성됨) $ django-admin startproject django_test 4. 프로젝트 생성 $ cd django_test $ python manage.py startapp banjubu 5. django_test/settings.py 수정 INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django...
1. Redis와 사용법 동일함. 2. 명시적 재부팅 불가. (버튼 비활성) 3. 데이터 유지. - 메모리 DB이므로 재부팅시 데이터가 삭제되어야 하지만 ElastiCache를 사용하면 영구적으로 유지된다고 봐도 무방함. - 인스턴스 업그레이드하더라도 데이터 유지됨. (복제본이 없어도 됨) 4. 인스턴스 업그레이드시 다운 타임 없다고 봐야 함. (데이터 양이 많은 경우는 테스트 못했으나 거의 없을 듯) 5. 높은 안정성을 위해 복제본 1개 이상 두는걸 권장. 6. 멀티 AZ를 두면 안정성이 더 높아지지만 추가 비용 발생.
기분은 어디있을까. 머리일까 가슴일까. 옛날 사람들은. 배에 있다고 생각했지. 어디에 있던지. 기분을 간질어야겠다. 항상 기분이 좋아지겠지. 기분이 안 좋은 날이었다. 나는 대부분 기분이 좋기 때문에 기분이 나쁜게 너무 거슬렸다. 기분은 어차피 손으로 만질 수 없고 느끼는 것이기에. 어디에 있던지 상관없이 느낌으로 간지를 수 있다. 이걸 확신하는 이유는 기분을 간질었더니 다시 기분이 좋아졌기 때문이다.
1. 공통 라이브러리용 깃헙 저장소 만들기 - 예) https://github.com/banjubu/banjubu-common-lib.git 2. 공통 라이브러리 저장소 루트에 index.js 생성 > 커밋 & 푸시 module.exports.banjubu = { go: function() { return "Go! Banjubu!"; } } 3. 신규 프로젝트 생성 > package.json 에 아래 코드 추가 - 처음 설치: yarn install - 코드 업데이트: yarn upgrade "dependencies": { ..., "banjubu-common-lib": "git+https://github.com/banjubu/banjubu-common-lib.git#main" } 4. app.js im..

새로운 폴더 만들고 시작할께요. 1. 설치 $ go mod init banjubu $ go get github.com/gin-gonic/gin $ go get github.com/99designs/gqlgen $ printf '// +build tools\npackage tools\nimport _ "github.com/99designs/gqlgen"' | gofmt > tools.go $ go run github.com/99designs/gqlgen init $ rm -rf server.go 2. main.go package main import ( "banjubu/graph" "banjubu/graph/generated" "github.com/99designs/gqlgen/graphql/handler..

새로운 폴더 만들고 시작할께요. 1. 설치 $ go mod init banjubu $ go get github.com/99designs/gqlgen $ printf '// +build tools\npackage tools\nimport _ "github.com/99designs/gqlgen"' | gofmt > tools.go $ go run github.com/99designs/gqlgen init $ go run server.go 2. graph/resolver.go package graph import "banjubu/graph/model" // This file will not be regenerated automatically. // // It serves as dependency injecti..

Supervisor: Node.js 진영의 PM2와 유사한 프로세스 컨트롤러. 1. Go 빌드 > main 파일 생성 $ go build main.go 2. Supervisor 설치 $ pip install supervisor 3. supervisor.conf [supervisord] [supervisorctl] serverurl=http://127.0.0.1:9001 [inet_http_server] port = 127.0.0.1:9001 [program:ginTest] command = ./main autostart = true autorestart = true startsecs = 1 4. 실행 $ supervisord -c supervisor.conf 5. 확인 http://localhost:90..
1. S3 업로드 2022.05.18 - [IT 인터넷/Golang] - [Golang] 파일 업로드 > S3
1. 패키지 다운로드 $ go get github.com/aws/aws-sdk-go-v2/aws $ go get github.com/aws/aws-sdk-go-v2/config 2. 주요 코드 // 업로드된 파일 정보 imageFile, imageFileHeader, _ := c.Request.FormFile("imageFile") // 바이트 버퍼로 변환 buf := make([]byte, imageFileHeader.Size) imageFile.Read(buf) // AWS 세션 생성 session, err := session.NewSession(&aws.Config{ Region: aws.String("ap-northeast-2"), Credentials: credentials.NewStaticCr..
1. .env MYSQL_HOST = "" MYSQL_USER = "" MYSQL_PASSWORD = "" MYSQL_DBNAME = "" MYSQL_PROTOCOL = "tcp" MYSQL_PORT = 3306 2. go.mod module myproject/main go 1.16 require ( github.com/gin-contrib/cors v1.3.1 // indirect github.com/gin-gonic/gin v1.7.7 // indirect github.com/go-playground/validator/v10 v10.11.0 // indirect github.com/go-sql-driver/mysql v1.6.0 // indirect github.com/golang/protobuf v..