configs

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CREATE_BOARD_ADMIN       = 1
	CREATE_BOARD_TYPE        = 0 /* board */
	CREATE_BOARD_NAME        = "board name"
	CREATE_BOARD_INFO        = "description for this board"
	CREATE_BOARD_ROWS        = 15
	CREATE_BOARD_WIDTH       = 1000
	CREATE_BOARD_USE_CAT     = 1
	CREATE_BOARD_LV_LIST     = 0
	CREATE_BOARD_LV_VIEW     = 0
	CREATE_BOARD_LV_WRITE    = 1 /* 0 is not allowed */
	CREATE_BOARD_LV_COMMENT  = 1 /* 0 is not allowed */
	CREATE_BOARD_LV_DOWNLOAD = 1 /* 0 is not allowed */
	CREATE_BOARD_PT_VIEW     = 0
	CREATE_BOARD_PT_WRITE    = 5
	CREATE_BOARD_PT_COMMENT  = 2
	CREATE_BOARD_PT_DOWNLOAD = -10
)

게시판 생성 시 기본값 정의

View Source
const (
	BOARD_DEFAULT = 0
	BOARD_GALLERY = 1
	BOARD_BLOG    = 2
	BOARD_SHOP    = 3
)

게시판 타입 목록

Variables

This section is empty.

Functions

func GetFileSizeLimit

func GetFileSizeLimit() int

HTTP 요청 크기 제한값 가져오기

func GetJWTAccessRefresh added in v1.0.2

func GetJWTAccessRefresh() (int, int)

JWT 유효 기간 (access: hours, refresh: days) 반환

func Install

func Install() bool

TSBOARD 백엔드 실행 시 설치 여부 검사 후 필요 시 설치 진행

func LoadConfig

func LoadConfig()

.env 파일에서 설정 내용 불러오기

Types

type AdminInfo

type AdminInfo struct {
	Id string
	Pw string
}

type Config

type Config struct {
	Version           string
	Port              string
	URL               string
	URLPrefix         string
	Title             string
	ProfileSize       string
	ContentInsertSize string
	ThumbnailSize     string
	FullSize          string
	FileSizeLimit     string
	DBHost            string
	DBUser            string
	DBPass            string
	DBName            string
	Prefix            string
	DBPort            string
	DBSocket          string
	DBMaxIdle         string
	DBMaxOpen         string
	JWTSecretKey      string
	JWTAccessHours    string
	JWTRefreshDays    string
	GmailID           string
	GmailAppPassword  string
	OAuthGoogleID     string
	OAuthGoogleSecret string
	OAuthNaverID      string
	OAuthNaverSecret  string
	OAuthKakaoID      string
	OAuthKakaoSecret  string
	OpenaiKey         string
}
var Env Config

설정 저장한 변수

type DBInfo

type DBInfo struct {
	Host    string
	User    string
	Pass    string
	Name    string
	Port    string
	Prefix  string
	Socket  string
	MaxIdle string
	MaxOpen string
}

type ImageSize

type ImageSize uint8

숫자 형태로 반환이 필요한 항목 정의

const (
	SIZE_PROFILE ImageSize = iota
	SIZE_CONTENT_INSERT
	SIZE_THUMBNAIL
	SIZE_FULL
	SIZE_FILE
)

func (ImageSize) Number

func (s ImageSize) Number() uint

사이즈 반환하기

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL