config

package
v0.0.0-...-adb56df Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Local = "local"
	Prod  = "prod"
)
View Source
const (
	ExifOrientationNone                = 1 // 不要
	ExifOrientationHorizontal          = 2 // 水平方向に反転
	ExifOrientationRotate180           = 3 // 時計回りに180度回転
	ExifOrientationVertical            = 4 // 垂直方向に反転
	ExifOrientationHorizontalRotate270 = 5 // 水平方向に反転 + 時計回りに270度回転
	ExifOrientationRotate90            = 6 // 時計回りに90度回転
	ExifOrientationHorizontalRotate90  = 7 // 水平方向に反転 + 時計回りに90度回転
	ExifOrientationRotate270           = 8 // 時計回りに270度回転
)
View Source
const AccessTokenLength = 512
View Source
const AssetPreviewImageName = "preview"
View Source
const AssetThumbnailImageName = "thumbnail"
View Source
const ClientSessionKey string = "client_session"
View Source
const ElasticsearchPhotoIndexName = "photo"
View Source
const ExifTagIDDateTimeOriginal = 36867
View Source
const ExifTagOrientation = 274
View Source
const OauthClientKey string = "oauth_client"
View Source
const PhotoUploadSignExpireInSec = 300
View Source
const RefreshTokenLength = 1024
View Source
const UserIDKey string = "user_id"

Variables

This section is empty.

Functions

func InitEnv

func InitEnv()

Types

type FamiPhotoEnv

type FamiPhotoEnv struct {
	AppEnv                     string   `envconfig:"APP_ENV"`
	Port                       int64    `envconfig:"PORT"`
	WebClientID                string   `envconfig:"WEB_CLIENT_ID"`
	WebClientSecret            string   `envconfig:"WEB_CLIENT_SECRET"`
	MySQLUser                  string   `envconfig:"MYSQL_USER"`
	MySQLPassword              string   `envconfig:"MYSQL_PASSWORD"`
	MySQLHostName              string   `envconfig:"MYSQL_HOST_NAME" required:"1"`
	MySQLPort                  string   `envconfig:"MYSQL_PORT"`
	MySQLDatabase              string   `envconfig:"MYSQL_DATABASE"`
	OauthRedisHostName         string   `envconfig:"OAUTH_REDIS_HOST_NAME"`
	OauthRedisDatabase         int64    `envconfig:"OAUTH_REDIS_DATABASE"`
	HMacKey                    string   `envconfig:"HMAC_KEY"`
	CCAccessTokenExpireInSec   int64    `envconfig:"CC_ACCESS_TOKEN_EXPIRE_IN_SEC"`
	UserAccessTokenExpireInSec int64    `envconfig:"USER_ACCESS_TOKEN_EXPIRE_IN_SEC"`
	AccessTokenHashedPrefix    string   `envconfig:"ACCESS_TOKEN_HASHED_PREFIX"`
	LoginTokenHashedPrefix     string   `envconfig:"LOGIN_TOKEN_HASHED_PREFIX"`
	UploadTokenHashedPrefix    string   `envconfig:"UPLOAD_TOKEN_HASHED_PREFIX"`
	LoginTokenExpireSec        int64    `envconfig:"LOGIN_TOKEN_EXPIRE_SEC"`
	ElasticsearchAddresses     []string `envconfig:"ELASTICSEARCH_ADDRESSES"`
	ElasticsearchUserName      string   `envconfig:"ELASTICSEARCH_USERNAME" default:"elastic"`
	ElasticsearchPassword      string   `envconfig:"ELASTICSEARCH_PASSWORD"`
	// ElasticsearchFingerPrint Fingerprint for certification. You can get following command on elasticsearch server.
	// `# cat /etc/elasticsearch/certs/http_ca.crt | openssl x509 -sha256 -fingerprint -noout | cut -d "=" -f 2 | sed "s/://g"`
	ElasticsearchFingerPrint string `envconfig:"ELASTICSEARCH_FINGER_PRINT"`
	ExifTimezone             string `envconfig:"EXIF_TIMEZONE"`
	AssetBaseURL             string `envconfig:"ASSET_BASE_URL"`
	PhotoUploadBaseURL       string `envconfig:"PHOTO_UPLOAD_BASE_URL"`
	ErrorLogFilePath         string `envconfig:"ERROR_LOG_FILE_PATH" default:"/var/log/famiphoto/error.log"`
	InfoLogFilePath          string `envconfig:"INFO_LOG_FILE_PATH" default:"/var/log/famiphoto/info.log"`
	StorageRootPath          string `envconfig:"STORAGE_ROOT_PATH" default:"/mnt/famiphoto"`
	TempLocalRootPath        string `envconfig:"TEMP_LOCAL_ROOT_PATH" default:"/tmp"`
	AssetRootPath            string `envconfig:"ASSET_ROOT_PATH" default:"/var/www/famiphoto"`
}
var Env FamiPhotoEnv

func (FamiPhotoEnv) IsDebug

func (e FamiPhotoEnv) IsDebug() bool

Jump to

Keyboard shortcuts

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