Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AvailableStatusOnline = "online" AvailableStatusOffline = "offline" )
View Source
var (
CF = &Configs{}
)
Functions ¶
Types ¶
type AvailableConfig ¶
type AvailableConfig struct {
Status string `json:"status"`
}
type Configs ¶
type Configs struct { Info struct { Name string `mapstructure:"NAME"` Description string `mapstructure:"DESCRIPTION"` Pubkey string `mapstructure:"PUBKEY"` Contact string `mapstructure:"CONTACT"` SupportedNIPs []int `mapstructure:"SUPPORTED_NIPS" json:"supported_nips"` Software string `mapstructure:"SOFTWARE"` Version string `mapstructure:"VERSION"` Icon string `mapstructure:"ICON"` /*Limitation struct { MaxMessageLength int `mapstructure:"MAX_MESSAGE_LENGTH"` MaxSubscriptions int `mapstructure:"MAX_SUBSCRIPTIONS"` MaxFilters int `mapstructure:"MAX_FILTERS"` MaxLimit int `mapstructure:"MAX_LIMIT"` MaxSubidLength int `mapstructure:"MAX_SUBID_LENGTH"` MaxEventTags int `mapstructure:"MAX_EVENT_TAGS"` MaxContentLength int `mapstructure:"MAX_CONTENT_LENGTH"` MinPowDifficulty int `mapstructure:"MIN_POW_DIFFICULTY"` AuthRequired bool `mapstructure:"AUTH_REQUIRED"` PaymentRequired bool `mapstructure:"PAYMENT_REQUIRED"` RestrictedWrites bool `mapstructure:"RESTRICTED_WRITES"` } `mapstructure:"LIMITATION"`*/ Limitation *infoLimitation `mapstructure:"LIMITATION"` } `mapstructure:"INFO"` App struct { AvailableStatus string // สถานะปิด/เปิดระบบ [on/off] Port int `mapstructure:"PORT"` Environment Environment `mapstructure:"ENVIRONMENT"` } `mapstructure:"APP"` Database struct { RelaySQL DatabaseConfig `mapstructure:"RELAY_SQL"` } `mapstructure:"DATABASE"` HTMLTemplate struct { SystemMaintenance string `mapstructure:"SYSTEM_MAINTENANCE"` } `mapstructure:"HTML_TEMPLATE"` }
func (*Configs) ReadConfigAvailableDescription ¶
ReadConfigAvailableDescription read config available description อ่าน config html ใช้แสดงเมื่อปิดระบบ
func (*Configs) SetConfigAvailableDescription ¶
SetConfigAvailableDescription set config available description สร้าง config html ใช้แสดงเมื่อปิดระบบ
func (*Configs) SetConfigAvailableStatus ¶
SetConfigAvailableStatus set config available status สร้าง config สถานะ ปิด/เปิด ระบบ
type DatabaseConfig ¶
type DatabaseConfig struct { Host string `mapstructure:"HOST"` Port int `mapstructure:"PORT"` Username string `mapstructure:"USERNAME"` Password string `mapstructure:"PASSWORD"` DatabaseName string `mapstructure:"DATABASE_NAME"` Timeout string `mapstructure:"TIMEOUT"` MaxIdleConns int `mapstructure:"MAX_IDLE_CONNS"` MaxOpenConns int `mapstructure:"MAX_OPEN_CONNS"` MaxLifetime time.Duration `mapstructure:"MAX_LIFE_TIME"` }
type Environment ¶
type Environment string
Environment environment
const ( Develop Environment = "develop" Production Environment = "prod" )
func (Environment) Production ¶
func (e Environment) Production() bool
Production check is production
Click to show internal directories.
Click to hide internal directories.