일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- nohup
- STF_PortForwarding
- Jupyter
- nmap
- centos
- PYTHON
- GoCD
- postgresql
- nGrinder
- port forwarding
- ftp
- 28015
- 실행권한
- Jupyter Notebook
- ubuntu
- sshpass
- SWIFT
- insert
- STF
- mysql
- postgres
- appium
- kitura
- perfect
- Materials
- create table
- openpyxl
- appium server
- ssh
- rethinkdb
- Today
- Total
don't stop believing
이번에는 파일 업로드를 해보겠습니다.https://github.com/gin-gonic/gin#upload-files 파일 하나 올리는 것과, 여러개를 동시에 올리는 것을 해보겠습니다.우선 파일을 올릴 수 있는 html 파일을 아래와 같이 만들어 줍니다. 저는 uploadfiles.html로 만들었습니다.위치는 templates 폴더 안에 위치합니다. page: {{ .page }} upload file: 이번에는 server.go 내용입니다. package main import ( "fmt" "log" "net/http" "path/filepath" "github.com/gin-gonic/gin" ) func setupRouter() *gin.Engine { // Disable Console Color..
간혹 네트워크 구성도를 그릴때가 있습니다.보통 PPT로 그리려고 하는데 그럴때 마다 네트워크 아이콘을 찾는게 일이었습니다. Gliffy를 쓰니 편하네요.Google Chrome Extension으로도 있습니다.https://chrome.google.com/webstore/detail/gliffy-diagrams/bhmicilclplefnflapjmnngmkkkkpfad?hl=en Gliffy에서 그리고 스크린샷 떠서 ppt에 추가하면 편합니다.gliffy 파일로 저장도 할 수 있습니다.
query string이나 post로 넘기는 데이터를 map 형식으로 사용하는 것은 이번에 처음 알게 되었습니다.https://github.com/gin-gonic/gin#map-as-querystring-or-postform-parameters 아래와 같이 ids[a]=123 그리고 ids[b]=hello 처럼 사용할 수 있습니다./post?ids[a]=1234&ids[b]=hello 마찬가지로 html의 form에서도 map 형식의 데이터를 넘길 수 있습니다. 이번에는 tamplate을 사용해 html 페이지를 실행하겠습니다.먼저 tamplates라는 폴더를 만들고 그 안에 note.html 파일을 만들어 줍니다. 그리고 아래와 같이 작성합니다. page: {{ .page }} first name: ..
지난 Posting에 이어 하나 더 해보겠습니다.Multipart/Urlencoded Form html 페이지의 form tag 중 action의 값인 url에 query string이 붙어있는 경우 입니다.https://github.com/gin-gonic/gin#another-example-query--post-form message: nick: form의 action으로 넘기는 url에 주렁주렁 query string이 달려 있습니다.http://localhost:8080/form_post_with_querystring?id=dejavu&page=34 이럴때 query string의 parameter와 form tag로 전달되는 post 데이터를 같이 받는 방법입니다. package main imp..
html의 form tag로 데이터를 보내고 확인해 보겠습니다.https://github.com/gin-gonic/gin#multiparturlencoded-form 먼저 아래와같이 html 페이지가 있다가 가정해 보겠습니다. message: nick: form tag의 action은 데이터를 넘기는 url입니다. method는 post로 넘어갑니다.넘기는 데이터로는 message와 nick이 있습니다.실행하면 아래와 같은 화면입니다.이제 go 코드 입니다. package main import ( "github.com/gin-gonic/gin" ) func setupRouter() *gin.Engine { // Disable Console Color // gin.DisableConsoleColor() r..
url의 ? 뒤에 따라오는 Query String 처리 입니다.이번 예제는 ? 뒤에 firstname 과 lastname이 map 형태의 parameter로 전달되게 됩니다.https://github.com/gin-gonic/gin#querystring-parameters package main import ( "github.com/gin-gonic/gin" ) func setupRouter() *gin.Engine { // Disable Console Color // gin.DisableConsoleColor() r := gin.Default() r.GET("/welcome", welcomeQueryString) return r } // Query string parameters are parsed u..