config

package
v0.0.0-...-8cf13af Latest Latest
Warning

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

Go to latest
Published: May 14, 2015 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HostURL    = "http://localhost:3000"
	APIRoot    = "/api"
	APIVersion = "v1"
	APIURL     = APIRoot + "/" + APIVersion
)

Constants for API

View Source
const (
	AWSAccessKeyID                     = ""
	AWSSecretAccessKey                 = ""
	AWSS3RegionName                    = ""
	AWSS3BucketName                    = ""
	AWSS3BucketPrefix                  = ""
	AWSStaticS3BucketName              = ""
	AWSElasticBeanstalkS3BucketName    = ""
	AWSElasticBeanstalkRegion          = ""
	AWSElasticBeanstalkAppName         = ""
	AWSElasticBeanstalkEnvironmentID   = ""
	AWSElasticBeanstalkEnvironmentName = ""
	AWSCloudfrontURL                   = ""
)

Constants for Amazon AWS

View Source
const (
	MysqlProtocol = "tcp"
	// for DEVELOPMENT
	MysqlHostDev     = "127.0.0.1"
	MysqlPortDev     = "3306"
	MysqlUserDev     = "root"
	MysqlPasswordDev = ""
	MysqlDatabaseDev = "goyangi_dev"
	MysqlOptionsDev  = "charset=utf8&parseTime=True"
	MysqlDSLDev      = MysqlUserDev + ":" + MysqlPasswordDev + "@" + MysqlProtocol + "(" + MysqlHostDev + ":" + MysqlPortDev + ")/" + MysqlDatabaseDev + "?" + MysqlOptionsDev
	// for TEST
	MysqlHostTest     = "127.0.0.1"
	MysqlPortTest     = "3306"
	MysqlUserTest     = "root"
	MysqlPasswordTest = ""
	MysqlDatabaseTest = "goyangi_test"
	MysqlOptionsTest  = "charset=utf8&parseTime=True"
	MysqlDSLTest      = MysqlUserTest + ":" + MysqlPasswordTest + "@" + MysqlProtocol + "(" + MysqlHostTest + ":" + MysqlPortTest + ")/" + MysqlDatabaseTest + "?" + MysqlOptionsTest
	// for PRODUCTION
	MysqlHost          = "127.0.0.1"
	MysqlPort          = "3306"
	MysqlUser          = "root"
	MysqlPassword      = ""
	MysqlDatabase      = "goyangi"
	MysqlOptions       = "charset=utf8&parseTime=True"
	MysqlDSLProduction = MysqlUser + ":" + MysqlPassword + "@" + MysqlProtocol + "(" + MysqlHost + ":" + MysqlPort + ")/" + MysqlDatabase + "?" + MysqlOptions
)

Constants for database.

View Source
const (
	SendEmail     = false
	EmailFrom     = ""
	EmailTestTo   = ""
	EmailHost     = ""
	EmailUsername = ""
	EmailPassword = ""
	EmailPort     = 465
	// EmailTimeout  = 80 * time.Millisecond
	EmailTimeout = 10 * time.Second
)
View Source
const (
	Title                 = "Goyangi"
	Frontend              = "CanJS"
	DefaultLanguage       = "en"
	StaticUrl             = "/static"
	StaticPathDevelopment = "frontend/canjs/static"
	StaticPathProduction  = "frontend/canjs/static-build"
)

Constants for frontend.

View Source
const (
	PrefixGuid           = "Goyangi"
	Guid                 = "20140708-140339f2"
	OldGuid              = "20140627-116dc11a"
	VeryOldGuid          = ""
	ExtremelyVeryOldGuid = ""
)

Constants for guid.

View Source
const (
	ImageWidth      = 500
	ImageHeight     = 500
	ThumbnailWidth  = 100
	ThumbnailHeight = 100
)

Constants for image.

View Source
const (
	AccessLogFilePath      = "log/access"
	AccessLogFileExtension = ".txt"
	AccessLogMaxSize       = 5 // megabytes
	AccessLogMaxBackups    = 7
	AccessLogMaxAge        = 30 //days
	ErrorLogFilePath       = "log/error"
	ErrorLogFileExtension  = ".json"
	ErrorLogMaxSize        = 10 // megabytes
	ErrorLogMaxBackups     = 7
	ErrorLogMaxAge         = 30 //days
)

Constants for logger.

View Source
const (
	OauthURL                  = HostURL + APIURL + "/oauth"
	OauthGoogleClientID       = ""
	OauthGoogleClientSecret   = ""
	OauthGoogleRedirectURL    = OauthURL + "/google/redirect"
	OauthGithubClientID       = ""
	OauthGithubClientSecret   = ""
	OauthGithubRedirectURL    = OauthURL + "/github/redirect"
	OauthYahooClientID        = ""
	OauthYahooClientSecret    = ""
	OauthYahooRedirectURL     = OauthURL + "/yahoo/redirect"
	OauthFacebookClientID     = ""
	OauthFacebookClientSecret = ""
	OauthFacebookRedirectURL  = OauthURL + "/facebook/redirect"
	OauthTwitterClientID      = ""
	OauthTwitterClientSecret  = ""
	OauthTwitterRedirectURL   = OauthURL + "/twitter/redirect"
	OauthLinkedinClientID     = ""
	OauthLinkedinClientSecret = ""
	OauthLinkedinRedirectURL  = OauthURL + "/linkedin/redirect"
	OauthKakaoClientID        = ""
	OauthKakaoClientSecret    = ""
	OauthKakaoRedirectURL     = OauthURL + "/kakao/redirect"
	OauthNaverClientID        = ""
	OauthNaverClientSecret    = ""
	OauthNaverRedirectURL     = OauthURL + "/naver/redirect"
)

Constants for oauth.

View Source
const (
	ArticleOrder  = "created_at desc"
	LocationOrder = "created_at desc"
	LikingOrder   = "created_at desc"
	LikedOrder    = "created_at desc"
	CommentOrder  = "created_at desc"
)

Constants for ordering models.

View Source
const (
	ArticlePerPage  = 10
	LocationPerPage = 2
	LikingPerPage   = 1
	LikedPerPage    = 1
	CommentPerPage  = 2
)

Constants for pagination.

View Source
const (
	UploadLocalPath = "/tmp/upload/"
	UploadS3Path    = "images/"
	//	UploadTarget = LOCAL | S3
	UploadTarget = "LOCAL"
	// UploadTarget  = "S3"
	UploadTimeout = 30 * time.Second
)

Constants for uploader.

View Source
const (
	AuthTokenExpirationDay = 1000
)

Constants for Authentication

View Source
const (
	// DEVELOPMENT | TEST | PRODUCTION
	Environment = "DEVELOPMENT"
)

Constants for environment.

View Source
const (
	UserPublicFields = "id, username, md5, description, created_at, liking_count, liked_count"
)

Constants for public models.

Variables

This section is empty.

Functions

func MysqlDSL

func MysqlDSL() string

MysqlDSL return mysql DSL.

func StaticPath

func StaticPath() string

StaticPath return static path for each environment.

Types

This section is empty.

Jump to

Keyboard shortcuts

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