conf

package
v1.4012.332 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const API_PREFIX = `/api`
View Source
const CookieDays = 30
View Source
const CookieLogoutValue = `LOGOUT`
View Source
const CookieName = `auth:`
View Source
const MAIL_VIEWS_DIR = `/views`
View Source
const MEDIA_SUBDIR = `media/`
View Source
const PROJECT_NAME = `github.com/kokizzu/gotro/W2/internal/example1` // must be the same as go.mod
View Source
const SuperAdmin = `admin@localhost`
View Source
const TokenSeparator = `|`

Variables

View Source
var (
	// ALL_CAPS = from .env
	// split per service when microservice
	TARANTOOL_HOST string
	TARANTOOL_PORT string
	TARANTOOL_USER string
	TARANTOOL_PASS string
	ROOT_DIR       string

	CLICKHOUSE_HOST string
	CLICKHOUSE_PORT string
	CLICKHOUSE_USER string
	CLICKHOUSE_PASS string

	WEBAPI_HOSTPORT string
	WEBAPI_EXEPATH  string

	MINIO_ENDPOINT   string
	MINIO_ACCESS_KEY string
	MINIO_SECRET_KEY string
	MINIO_USESSL     bool

	MAILER_HOST string
	MAILER_PORT int
	MAILER_USER string
	MAILER_PASS string

	// CameCase = from command line
	SERVICE_MODE string
	ENV          string
	DEBUG_MODE   bool

	UPLOAD_DIR string
	UPLOAD_URI string

	DOCKER_TLS_VERIFY   string
	DOCKER_HOST         string
	DOCKER_CERT_PATH    string
	DOCKER_MACHINE_NAME string

	OAUTH_URLS          []string
	OAUTH_CALLBACK_PATH string

	GPLUS_CLIENTID     string
	GPLUS_CLIENTSECRET string
	GPLUS_SCOPES       []string

	YAHOO_APPID        string
	YAHOO_CLIENTID     string
	YAHOO_CLIENTSECRET string
	YAHOO_SCOPES       []string

	GITHUB_CLIENTID     string
	GITHUB_CLIENTSECRET string
	GITHUB_SCOPES       []string

	STEAM_CLIENTID     string
	STEAM_CLIENTSECRET string

	TWITTER_CLIENTID     string
	TWITTER_CLIENTSECRET string
	TWITTER_SCOPES       []string

	FACEBOOK_APPID     string
	FACEBOOK_APPSECRET string
	FACEBOOK_SCOPES    []string

	GPLUS_OAUTH_PROVIDERS    map[string]*oauth2.Config
	YAHOO_OAUTH_PROVIDERS    map[string]*oauth2.Config
	GITHUB_OAUTH_PROVIDERS   map[string]*oauth2.Config
	STEAM_OAUTH_PROVIDERS    map[string]*oauth2.Config
	TWITTER_OAUTH_PROVIDERS  map[string]*oauth2.Config
	FACEBOOK_OAUTH_PROVIDERS map[string]*oauth2.Config

	GPLUS_USERINFO_ENDPOINT string
)
View Source
var AdminTestExpiredSession string
View Source
var AdminTestSessionToken string
View Source
var Admins = map[string]bool{
	SuperAdmin: true,
}
View Source
var VERSION = ``

Functions

func ConnectClickhouse

func ConnectClickhouse() *sql.DB

func ConnectTarantool

func ConnectTarantool() *tarantool.Connection

func InitLogger

func InitLogger() *zerolog.Logger

func LoadFromEnv

func LoadFromEnv(ignoreBinary ...any)

func LoadTestEnv

func LoadTestEnv() string

loads .env file even when the binary/test not in project's root directory returns project's root directory (where `.env` should be located)

func Logger

func Logger(log zerolog.Logger) func(*fiber.Ctx) error

Logger Middleware requestid + logger + recover for request traceability

Types

type Session

type Session struct {
	UserId    uint64
	ExpiredAt int64
	Email     string
}

func (*Session) Decrypt

func (s *Session) Decrypt(sessionToken string, userAgent string) bool

func (*Session) Encrypt

func (s *Session) Encrypt(userAgent string) string

func (*Session) MarshalEnkodo

func (u *Session) MarshalEnkodo(enc *enkodo.Encoder) (err error)

func (*Session) UnmarshalEnkodo

func (u *Session) UnmarshalEnkodo(dec *enkodo.Decoder) (err error)

Jump to

Keyboard shortcuts

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