GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — server/config/config.go at master · bangumi/server Expand file tree/ Copy pathconfig.goMore file actions 83 lines (68 loc) · 3.1 KB / Copy pathconfig.goFile metadata and controls83 lines (68 loc) · 3.1 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 // SPDX-License-Identifier: AGPL-3.0-only // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published // by the Free Software Foundation, version 3. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // See the GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/> package config import ( "fmt" "time" ) const AppTypeCanal = "canal" const AppTypeHTTP = "http" type AppConfig struct { Debug struct { Gorm bool `toml:"gorm"` } `toml:"debug"` RedisURL string `toml:"redis-url" env:"REDIS_URI" env-default:"redis://127.0.0.1:6379/0"` Mysql struct { Host string `toml:"host" env:"MYSQL_HOST" env-default:"127.0.0.1"` Port string `toml:"port" env:"MYSQL_PORT" env-default:"3306"` UserName string `toml:"user-name" env:"MYSQL_USER" env-default:"user"` Password string `toml:"password" env:"MYSQL_PASS" env-default:"password"` Database string `toml:"database" env:"MYSQL_DB" env-default:"bangumi"` MaxConn int `toml:"max-conn" env:"MYSQL_MAX_CONNECTION" env-default:"4"` MaxIdleTime time.Duration `toml:"max-idle-time" env-default:"4h"` MaxLifeTime time.Duration `toml:"max-life-time" env-default:"6h"` SlowSQLDuration time.Duration `toml:"slow-sql-duration" env:"SLOW_SQL_DURATION"` } `toml:"mysql"` HTTP struct { Host string `toml:"host" env:"HTTP_HOST" env-default:"127.0.0.1"` Port int `toml:"port" env:"HTTP_PORT" env-default:"3000"` } `toml:"http"` RateLimit struct { LimitLongTime time.Duration `toml:"long-time" env:"RATE_LIMIT_LONG_TIME" env-default:"1h"` LimitWindow time.Duration `toml:"window" env:"RATE_LIMIT_WINDOW" env-default:"10m"` LimitCount uint `toml:"count" env:"RATE_LIMIT_COUNT" env-default:"3000"` } `toml:"rate-limit"` Kafka struct { Broker string `toml:"broker" env:"KAFKA_BROKER"` Topics []string `toml:"topics"` } `toml:"kafka"` Search struct { MeiliSearch struct { URL string `toml:"url" env:"MEILISEARCH_URL"` Key string `toml:"key" env:"MEILISEARCH_KEY"` Timeout time.Duration `toml:"timeout" env:"MEILISEARCH_REQUEST_TIMEOUT" env-default:"2s"` } `toml:"meilisearch"` } `toml:"search"` NsfwWord string `toml:"nsfw-word"` DisableWords string `toml:"disable-words"` BannedDomain string `toml:"banned-domain"` S3EntryPoint string `toml:"s3-entry-point" env:"S3_ENTRY_POINT"` S3AccessKey string `toml:"s3-access-key" env:"S3_ACCESS_KEY"` S3SecretKey string `toml:"s3-secret-key" env:"S3_SECRET_KEY"` S3ImageResizeBucket string `toml:"s3-image-resize-bucket" env:"S3_IMAGE_RESIZE_BUCKET" env-default:"img-resize"` AppType string `toml:"app-type"` } func (c AppConfig) ListenAddr() string { return fmt.Sprintf("%s:%d", c.HTTP.Host, c.HTTP.Port) } |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |