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 = "" AWSS3TestBucketName = "" AWSS3TestBucketPrefix = "" 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 PostgresProtocol = "tcp" // for DEVELOPMENT PostgresHostDev = "127.0.0.1" PostgresPortDev = "5432" PostgresUserDev = "postgres" PostgresPasswordDev = "postgres" PostgresDatabaseDev = "goyangi_dev" PostgresOptionsDev = "sslmode=disable" PostgresDSLDev = "host=" + PostgresHostDev + " port=" + PostgresPortDev + " dbname=" + PostgresDatabaseDev + " " + PostgresOptionsDev + " user=" + PostgresUserDev + " password=" + PostgresPasswordDev PostgresDSLMigrateDev = PostgresUserDev + ":" + PostgresPasswordDev + "@" + PostgresHostDev + ":" + PostgresPortDev + "/" + PostgresDatabaseDev + "?" + PostgresOptionsDev // for TEST PostgresHostTest = "127.0.0.1" PostgresPortTest = "5432" PostgresUserTest = "postgres" PostgresPasswordTest = "postgres" PostgresDatabaseTest = "goyangi_test" PostgresOptionsTest = "sslmode=disable" PostgresDSLTest = "host=" + PostgresHostTest + " port=" + PostgresPortTest + " dbname=" + PostgresDatabaseTest + " " + PostgresOptionsTest + " user=" + PostgresUserTest + " password=" + PostgresPasswordTest PostgresDSLMigrateTest = PostgresUserTest + ":" + PostgresPasswordTest + "@" + PostgresHostTest + ":" + PostgresPortTest + "/" + PostgresDatabaseTest + "?" + PostgresOptionsTest // for PRODUCTION PostgresHost = "127.0.0.1" PostgresPort = "5432" PostgresUser = "postgres" PostgresPassword = "postgres" PostgresDatabase = "goyangi_production" PostgresOptions = "sslmode=disable" PostgresDSLProduction = "host=" + PostgresHost + " port=" + PostgresPort + " dbname=" + PostgresDatabase + " " + PostgresOptions + " user=" + PostgresUser + " password=" + PostgresPassword PostgresDSLMigrateProduction = PostgresUser + ":" + PostgresPassword + "@" + PostgresHost + ":" + PostgresPort + "/" + PostgresDatabase + "?" + PostgresOptions )
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 LargeWidth = 1920 LargeHeight = 1080 MediumWidth = 1024 MediumHeight = 768 ThumbnailWidth = 340 ThumbnailHeight = 270 )
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" )
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 = 5 LikedPerPage = 5 CommentPerPage = 2 )
Constants for pagination.
View Source
const ( UploadLocalPath = "/tmp/upload/" UploadS3ImagePath = "images/" // UploadTarget = LOCAL | S3 UploadTarget = "LOCAL" // UploadTarget = "S3" // UploadBucket = TEST | PRODUCTION UploadBucket = "TEST" 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 ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.