osenv

package module
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: GPL-3.0 Imports: 7 Imported by: 35

README

go get -u github.com/AnnonaOrg/osenv

Documentation

Index

Constants

View Source
const DOCKERENV_FILE string = "/.dockerenv"

Variables

View Source
var JWTSecret string

#JWT Secret JWT_SECRET=

Functions

func GenerateJWTSecret

func GenerateJWTSecret() string

func GenerateRandomString

func GenerateRandomString(n int) string

func GetAbsPath

func GetAbsPath(tmpName, defaultName string) string

获取绝对路径 tmpName:绝对/相对路径,defaultName:默认路径

func GetAppTelegramApiHash

func GetAppTelegramApiHash() string

app api hash

func GetAppTelegramApiID

func GetAppTelegramApiID() string

app api id

func GetBotAdminTelegramWebhookURL

func GetBotAdminTelegramWebhookURL() string

func GetBotManagerID

func GetBotManagerID() string

manager id

func GetBotTelegramAPIProxyURL

func GetBotTelegramAPIProxyURL() string

bot apiproxy url

func GetBotTelegramToken

func GetBotTelegramToken() string

Bot token

func GetBotTelegramWebhookURL

func GetBotTelegramWebhookURL() string

bot webhook url

func GetCopyrightLicenseCode

func GetCopyrightLicenseCode() string

func GetCoreApiToken

func GetCoreApiToken() string

# core api 验证token core_api_token CORE_API_TOKEN=

func GetCoreApiTokenReadOnly

func GetCoreApiTokenReadOnly() string

# core api 验证token (只读权限) core_api_token_readonly CORE_API_TOKEN_READONLY=

func GetCoreApiUrl

func GetCoreApiUrl() string

#core api url https://server.domain CORE_API_URL=

func GetFenxiaoApiUrl

func GetFenxiaoApiUrl() string

#fenxiao api url https://server.domain FENXIAO_API_URL=

func GetJWTSecret

func GetJWTSecret() string

func GetLogLevel

func GetLogLevel() string

LogLevel panic,fatal,error,warn,warning,info,debug,trace

func GetMQTTBroker

func GetMQTTBroker() string

# MQTT broker MQTT_BROKER= MQTT_USERNAME= MQTT_PASSWORD= MQTT_TOPIC=

func GetMQTTPassword

func GetMQTTPassword() string

func GetMQTTTopic

func GetMQTTTopic() string

func GetMQTTUsername

func GetMQTTUsername() string

func GetMtprotoProxyPort

func GetMtprotoProxyPort() string

func GetMtprotoProxyPortInt

func GetMtprotoProxyPortInt() int64

func GetMtprotoProxySecret

func GetMtprotoProxySecret() string

func GetMtprotoProxyServer

func GetMtprotoProxyServer() string

func GetNoticeOfFeedRichMsgPushUrl

func GetNoticeOfFeedRichMsgPushUrl() string

notice of feedRichMsg push url like https://server.domain

func GetNoticeOfFeedRichMsgPushUrlPath

func GetNoticeOfFeedRichMsgPushUrlPath() string

notice of feedRichMsg push url path like /ws/push/

func GetPaymentBTCPayKey

func GetPaymentBTCPayKey() string

#BTCPay 验证密钥 PAYMENT_BTCPAY_API_KEY=

func GetPaymentBTCPayName

func GetPaymentBTCPayName() string

# #BTCPay 标识 PAYMENT_BTCPAY_API_NAME=BTCPay

func GetPaymentBTCPayStoreID

func GetPaymentBTCPayStoreID() string

# BTCPay StoreID PAYMENT_BTCPAY_API_STOREID =

func GetPaymentBTCPayUrl

func GetPaymentBTCPayUrl() string

#BTCPay 接口地址 PAYMENT_BTCPAY_API_URL=https://mainnet.demo.btcpayserver.org

func GetPaymentBTCPayWebhookSecret

func GetPaymentBTCPayWebhookSecret() string

# BTCPay WebhookSecret PAYMENT_BTCPAY_API_WEBHOOK_SECRET=

func GetPaymentBoxcoinKey

func GetPaymentBoxcoinKey() string

#Boxcoin api 验证密钥

func GetPaymentBoxcoinName

func GetPaymentBoxcoinName() string

#Boxcoin 标识

func GetPaymentBoxcoinUrl

func GetPaymentBoxcoinUrl() string

#Boxcoin 接口地址 YOUR-DOMAIN/boxcoin/api.php

func GetPaymentBoxcoinWebhookKey

func GetPaymentBoxcoinWebhookKey() string

#Boxcoin webhook 验证密钥

func GetPaymentCryptAPIName

func GetPaymentCryptAPIName() string

# #CryptAPI 标识 PAYMENT_CRYPTAPI_API_NAME=CryptAPI

func GetPaymentEPUSDTKey

func GetPaymentEPUSDTKey() string

#EPUSDT 验证密钥 PAYMENT_EPUSDT_API_KEY=

func GetPaymentEPUSDTName

func GetPaymentEPUSDTName() string

#支付方式 #EPUSDT 标识 PAYMENT_EPUSDT_API_NAME=USDT

func GetPaymentEPUSDTUrl

func GetPaymentEPUSDTUrl() string

#EPUSDT 接口地址 PAYMENT_EPUSDT_API_URL=http://127.0.0.1:8000

func GetPaymentEasyPayDevice

func GetPaymentEasyPayDevice() string

#易支付 设备类型 PAYMENT_EASYPAY_API_DEVICE=

func GetPaymentEasyPayKey

func GetPaymentEasyPayKey() string

#易支付 验证密钥 PAYMENT_EASYPAY_API_KEY=

func GetPaymentEasyPayName

func GetPaymentEasyPayName() string

# #易支付 标识 PAYMENT_EASYPAY_API_NAME=易支付

func GetPaymentEasyPayPid

func GetPaymentEasyPayPid() string

#易支付 商户id PAYMENT_EASYPAY_API_PID=

func GetPaymentEasyPayUrl

func GetPaymentEasyPayUrl() string

#易支付 接口地址 PAYMENT_EASYPAY_API_URL=

func GetPaymentEasyRequstBodyEncode

func GetPaymentEasyRequstBodyEncode() string

#易支付 接口请求编码格式 JsonEncode URLValuesEncode PAYMENT_EASYPAY_REQUEST_BODY_ENCODE

func GetPaymentUmiPayKey added in v0.1.23

func GetPaymentUmiPayKey() string

验证密钥

func GetPaymentUmiPayName added in v0.1.23

func GetPaymentUmiPayName() string

func GetPaymentUmiPayPid added in v0.1.23

func GetPaymentUmiPayPid() string

商户id

func GetPaymentUmiPayUrl added in v0.1.23

func GetPaymentUmiPayUrl() string

func GetPlatformType

func GetPlatformType() string

#平台类型 tele #PLATFORM_TYPE_TELE PLATFORM_TYPE_TELE=tele

func GetRel

func GetRel(basepath, targpath string) string

https://www.cnblogs.com/malukang/p/12907945.html GetRel(uploadDir,uploadFilePath) 获取相对路径

func GetServerDbAddress

func GetServerDbAddress() string

连接地址,形式如 数据库域名:端口号 SERVER_DB_ADDRESS

func GetServerDbHost

func GetServerDbHost() string

数据库地址,如本地为 127.0.0.1 SERVER_DB_HOST

func GetServerDbName

func GetServerDbName() string

数据库名称,在mysql或psql中创建的数据库名称 SERVER_DB_NAME

func GetServerDbPassword

func GetServerDbPassword() string

数据库用户名密码 SERVER_DB_PASSWORD

func GetServerDbPort

func GetServerDbPort() string

数据库端口,mysql默认为3306 postgres默认端口为5432 SERVER_DB_PORT

func GetServerDbRedisAddress

func GetServerDbRedisAddress() string

server db redis address SERVER_DB_REDIS_ADDRESS 127.0.0.1:6379

func GetServerDbRedisDB

func GetServerDbRedisDB() int

server db redis Redis库 SERVER_DB_REDIS_DB 0 1 2 3

func GetServerDbRedisPassword

func GetServerDbRedisPassword() string

server db redis password SERVER_DB_REDIS_PASSWORD Redis密码

func GetServerDbRedisSlaveAddress added in v0.1.22

func GetServerDbRedisSlaveAddress() string

server db redis address SERVER_DB_REDIS_ADDRESS 127.0.0.1:6379

func GetServerDbRedisSlaveDB added in v0.1.22

func GetServerDbRedisSlaveDB() int

server db redis Redis库 SERVER_DB_REDIS_DB 0 1 2 3

func GetServerDbRedisSlavePassword added in v0.1.22

func GetServerDbRedisSlavePassword() string

server db redis password SERVER_DB_REDIS_PASSWORD Redis密码

func GetServerDbTablePrefix

func GetServerDbTablePrefix() string

#数据库数据表前缀,形式如 数据库域名:端口号 SERVER_DB_TABLE_PREFIX

func GetServerDbType

func GetServerDbType() string

数据库类型, mysql,sqlite,postgres 创建的mysql数据库数据集建议使用utf8mb4 SERVER_DB_TYPE

func GetServerDbUsername

func GetServerDbUsername() string

数据库用户名 SERVER_DB_USERNAME

func GetServerGinRunmode

func GetServerGinRunmode() string

#GIN run mode runmode SERVER_GIN_RUNMODE=release

func GetServerGinRunode() string {
	return GetServerGinRunmode()
}

func GetServerPort

func GetServerPort() string

server port :port :8080 SERVER_PORT

func GetServerUrl

func GetServerUrl() string

server url http://127.0.0.1:8080 SERVER_URL

func GetSocks5ProxyPassword

func GetSocks5ProxyPassword() string

func GetSocks5ProxyPort

func GetSocks5ProxyPort() string

func GetSocks5ProxyPortInt

func GetSocks5ProxyPortInt() int64

func GetSocks5ProxyServer

func GetSocks5ProxyServer() string

func GetSocks5ProxyUsername

func GetSocks5ProxyUsername() string

func GetTronScanOrgApikey added in v0.1.20

func GetTronScanOrgApikey() string

TRON-PRO-API-KEY https://tronscan.org/#/myaccount/apiKeys/

func GetTrongridApikey

func GetTrongridApikey() string

TRONGRID_API_KEY 通过 https://www.trongrid.io 注册获取

func Getenv

func Getenv(key string) string

func Getwd

func Getwd() string

获取程序运行目录相当于linux的pwd

func IsBotManagerID

func IsBotManagerID(id int64) bool

func IsBotManagerIDStr

func IsBotManagerIDStr(idStr string) bool

func IsEnableMtprotoProxy

func IsEnableMtprotoProxy() bool

#MtprotoProxy

func IsEnablePaymentBTCPay

func IsEnablePaymentBTCPay() bool

func IsEnablePaymentBoxcoin

func IsEnablePaymentBoxcoin() bool

func IsEnablePaymentCryptAPI

func IsEnablePaymentCryptAPI() bool

func IsEnablePaymentEPUSDT

func IsEnablePaymentEPUSDT() bool

func IsEnablePaymentEasyPay

func IsEnablePaymentEasyPay() bool

func IsEnablePaymentUmiPay added in v0.1.23

func IsEnablePaymentUmiPay() bool

func IsEnableSocks5Proxy

func IsEnableSocks5Proxy() bool

#Socks5

func IsInDocker

func IsInDocker() bool

func IsTDlibSimpleMessage

func IsTDlibSimpleMessage() bool

func PathExist

func PathExist(pathStr string) bool

判断文件是否存在

Types

This section is empty.

Jump to

Keyboard shortcuts

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