config

package
v0.0.0-...-d6f550b Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Roles = roles{
	Roles: base_roles.BaseRoles,
	Help: helpRoles{
		FaqCreate:     "help.faq.create",
		FaqUpdate:     "help.faq.update",
		FaqDeactivate: "help.faq.deactivate",
		FaqActivate:   "help.faq.activate",
		FaqReOrder:    "help.faq.reorder",
		FaqList:       "help.faq.list",
		FaqRead:       "help.faq.read",
		FaqSuper:      "help.faq.super",

		CategoryCreate:     "help.category.create",
		CategoryUpdate:     "help.category.update",
		CategoryDeactivate: "help.category.deactivate",
		CategoryActivate:   "help.category.activate",
		CategoryReOrder:    "help.category.reorder",
		CategoryList:       "help.category.list",
		CategoryRead:       "help.category.read",
		CategorySuper:      "help.category.super",

		ArticleCreate:     "help.article.create",
		ArticleUpdate:     "help.article.update",
		ArticleDeactivate: "help.article.deactivate",
		ArticleActivate:   "help.article.activate",
		ArticleReOrder:    "help.article.reorder",
		ArticleList:       "help.article.list",
		ArticleRead:       "help.article.read",
		ArticleSuper:      "help.article.super",

		HelpSuper: "help.super",
	},
}

Functions

This section is empty.

Types

type App

type App struct {
	DB struct {
		Help     MongoHelp
		Faq      MongoFaq
		Category MongoCategory
	}
	Http        Http
	HttpHeaders HttpHeaders
	I18n        I18n
	Nats        Nats
	Session     Session
	RSA         RSA
	Redis       Redis
	CacheRedis  CacheRedis
	TokenSrv    TokenSrv
}

type CacheRedis

type CacheRedis struct {
	Host string `env:"REDIS_CACHE_HOST"`
	Port string `env:"REDIS_CACHE_PORT"`
	Pw   string `env:"REDIS_CACHE_PASSWORD"`
	Db   int    `env:"REDIS_CACHE_DB"`
}

type Http

type Http struct {
	Host  string `env:"SERVER_HOST" envDefault:"localhost"`
	Port  int    `env:"SERVER_PORT" envDefault:"3000"`
	Group string `env:"SERVER_GROUP" envDefault:"account"`
}

type HttpHeaders

type HttpHeaders struct {
	AllowedOrigins   string `env:"CORS_ALLOWED_ORIGINS" envDefault:"*"`
	AllowedMethods   string `env:"CORS_ALLOWED_METHODS" envDefault:"GET,POST,PUT,DELETE,OPTIONS"`
	AllowedHeaders   string `env:"CORS_ALLOWED_HEADERS" envDefault:"*"`
	AllowCredentials bool   `env:"CORS_ALLOW_CREDENTIALS" envDefault:"true"`
	Domain           string `env:"HTTP_HEADER_DOMAIN" envDefault:"*"`
}

type I18n

type I18n struct {
	Fallback string   `env:"I18N_FALLBACK_LANGUAGE" envDefault:"en"`
	Dir      string   `env:"I18N_DIR" envDefault:"./src/locales"`
	Locales  []string `env:"I18N_LOCALES" envDefault:"en,tr"`
}

type MongoCategory

type MongoCategory struct {
	Collection string `env:"MONGO_CATEGORY_COLLECTION" envDefault:"categories"`
}

type MongoFaq

type MongoFaq struct {
	Collection string `env:"MONGO_FAQ_COLLECTION" envDefault:"faqs"`
}

type MongoHelp

type MongoHelp struct {
	Host       string `env:"MONGO_HELP_HOST" envDefault:"localhost"`
	Port       string `env:"MONGO_HELP_PORT" envDefault:"27017"`
	Username   string `env:"MONGO_HELP_USERNAME" envDefault:""`
	Password   string `env:"MONGO_HELP_PASSWORD" envDefault:""`
	Database   string `env:"MONGO_HELP_DATABASE" envDefault:"help"`
	Collection string `env:"MONGO_HELP_COLLECTION" envDefault:"helps"`
	Query      string `env:"MONGO_HELP_QUERY" envDefault:""`
}

type Nats

type Nats struct {
	Url     string   `env:"NATS_URL" envDefault:"nats://localhost:4222"`
	Streams []string `env:"NATS_STREAMS" envDefault:""`
}

type RSA

type RSA struct {
	PrivateKeyFile string `env:"RSA_PRIVATE_KEY"`
	PublicKeyFile  string `env:"RSA_PUBLIC_KEY"`
}

type Redis

type Redis struct {
	Host string `env:"REDIS_HOST"`
	Port string `env:"REDIS_PORT"`
	Pw   string `env:"REDIS_PASSWORD"`
	Db   int    `env:"REDIS_DB"`
}

type Session

type Session struct {
	Topic string `env:"SESSION_TOPIC"`
}

type TokenSrv

type TokenSrv struct {
	Expiration int    `env:"TOKEN_EXPIRATION" envDefault:"3600"`
	Project    string `env:"TOKEN_PROJECT" envDefault:"empty"`
}

Jump to

Keyboard shortcuts

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