Documentation ¶
Index ¶
- func Abs(n int) int
- func AskImageDescription(path string) (string, error)
- func CheckCommentParameters(c fiber.Ctx) (models.CommentWriteParameter, error)
- func CheckWriteParameters(c fiber.Ctx) (models.EditorWriteParameter, error)
- func ConvJsonString(value interface{}) (string, error)
- func ConvTimestamp(timestamp uint64) string
- func ConvUnixMilli(timeStr string) uint64
- func CopyFile(destPath string, file multipart.File) error
- func CutString(s string, max int) string
- func DownloadImage(imageUrl string, outputPath string, width uint) error
- func EncodeImage(path string) (string, error)
- func Err(c fiber.Ctx, msg string, code models.Code) error
- func Escape(raw string) string
- func ExtractExif(imagePath string) models.BoardExif
- func ExtractUserUid(authorization string) int
- func GenerateAccessToken(userUid uint, hours int) (string, error)
- func GenerateRefreshToken(days int) (string, error)
- func GetContentStatus(isNotice bool, isSecret bool) models.Status
- func GetFileSize(path string) uint
- func GetHashedString(input string) string
- func IsImage(path string) bool
- func IsValidEmail(email string) bool
- func MakeSavePath(target models.UploadCategory) (string, error)
- func MakeTempJpeg(path string) (string, error)
- func OAuth2ExchangeToken(c fiber.Ctx, cfg oauth2.Config) (*oauth2.Token, error)
- func Ok(c fiber.Ctx, result interface{}) error
- func Purify(input string) string
- func ResizeImage(inputPath string, outputPath string, width uint) error
- func ResponseAuthFail(c fiber.Ctx, userUid int) error
- func Sanitize(input string) string
- func SaveAttachmentFile(file *multipart.FileHeader) (string, error)
- func SaveCookie(c fiber.Ctx, name string, value string, days int)
- func SaveImage(inputBuffer []byte, outputPath string, width uint) error
- func SaveInsertImage(inputPath string) (string, error)
- func SaveProfileImage(inputPath string) (string, error)
- func SaveThumbnailImage(inputPath string) (models.BoardThumbnail, error)
- func SaveUploadedFile(file multipart.File, fileName string) (string, error)
- func SendMail(to string, subject string, body string) bool
- func Unescape(escaped string) string
- func ValidateJWT(tokenStr string) (*jwt.Token, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AskImageDescription ¶
OpenAI의 API를 이용해서 사진에 대한 설명 가져오기
func CheckCommentParameters ¶
func CheckCommentParameters(c fiber.Ctx) (models.CommentWriteParameter, error)
새 댓글 및 답글 작성 시 파라미터 체크
func CheckWriteParameters ¶
func CheckWriteParameters(c fiber.Ctx) (models.EditorWriteParameter, error)
글 작성/수정 시 파라미터 검사 및 타입 변환
func ConvTimestamp ¶
Unix timestamp 형식의 숫자를 YYYY:mm:dd HH:ii:ss 형태로 변경
func ConvUnixMilli ¶
YYYY:mm:dd HH:ii:ss 형태의 시간 문자를 Unix timestamp로 변경
func DownloadImage ¶
URL로부터 이미지 경로를 받아서 지정된 크기로 줄이고 .webp 형식으로 저장
func ExtractUserUid ¶
헤더로 넘어온 Authorization 문자열 추출해서 사용자 고유 번호 반환
func GenerateAccessToken ¶
액세스 토큰 생성하기 (유효시간 기입 필요)
func GenerateRefreshToken ¶
리프레시 토큰 생성하기 (유효일자 기입 필요)
func GetContentStatus ¶
게시글/댓글 상태값 반환
func MakeSavePath ¶
func MakeSavePath(target models.UploadCategory) (string, error)
파일 저장 경로 만들기 (맨 앞 `.` 은 DB에 넣을 때 빼줘야함)
func MakeTempJpeg ¶
이미지 비전용으로 잠시 사용하고 삭제할 고압축 미니 썸네일 생성
func OAuth2ExchangeToken ¶
상태 검사 및 토큰 교환 후 토큰 반환
func ResizeImage ¶
이미지를 주어진 크기로 줄여서 .webp 형식으로 저장하기
func ResponseAuthFail ¶ added in v1.0.2
인증 실패 코드에 맞춰서 클라이언트에 리턴
func SaveAttachmentFile ¶
func SaveAttachmentFile(file *multipart.FileHeader) (string, error)
업로드 된 파일을 attachments 폴더에 저장하고 경로 반환
func SaveThumbnailImage ¶
func SaveThumbnailImage(inputPath string) (models.BoardThumbnail, error)
썸네일 이미지 저장하고 경로 반환
func SaveUploadedFile ¶
업로드 된 파일을 임시 폴더에 저장하고 경로 반환
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.