본문 바로가기 메뉴 바로가기

just_HS

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

just_HS

검색하기 폼
  • 분류 전체보기 (500)
    • python (6)
    • golang (108)
    • embedded (25)
    • google cloud platform (3)
    • google colaboratory (4)
    • deep learning (3)
    • blockchain (9)
    • git (15)
    • etc (16)
    • life-health (25)
    • javascript30 (19)
    • development (76)
    • book-movie (126)
    • til (40)
    • generative-ai (8)
    • book: how minds change (2)
    • develop-and-AI (15)
  • 방명록

echo framework (1)
Golang: embed한 파일을 API 요청에 회신해주기

개요 1. 특정 파일 하나를 embed 하여 고객이 template으로 요구할 경우 다운로드 할 수 있도록 하고 싶다. 2. Golang echo framework 를 사용중이다. 내용 GitHub: https://github.com/nicewook/echo-serve-embedfile embed로 가져온 다음 ReadFile() 메서드로 파일을 읽어 바이트 슬라이스로 만든 다음 Content Disposition 헤더로 파일이름을 지정하고 ContentType을 명시한 다음 바이트 슬라이스를 회신한다. //go:embed static var static embed.FS func main() { e := echo.New() e.GET("/csv", func(c echo.Context) error { p,..

golang 2023. 1. 4. 15:54
이전 1 다음
이전 다음
반응형
잡학툰 뱃지
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
TAG
  • agile
  • clean agile
  • bun
  • gocore
  • golang
  • API
  • middleware
  • 인텔리제이
  • backend
  • 독서
  • solid
  • Gin
  • 영화
  • notion
  • 오블완
  • 잡학툰
  • 체호프
  • 독서후기
  • OpenAI
  • Echo
  • websocket
  • github
  • go
  • 티스토리챌린지
  • postgres
  • MCP
  • 클린 애자일
  • intellij
  • strange
  • ChatGPT
more
«   2026/02   »
일 월 화 수 목 금 토
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
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바