config

package
v0.0.0-...-1bf96ee Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WorkSpace string = "/zihao/master/"
	//WorkSpace string = "/Users/wuxuewen"
	Slave                                int    = 7001
	Remote_Images_Url                    string = "http://bbs.homecommunity.cn/app/zihaoApp.listZihaoApp"
	Remote_My_Images_Url                 string = "http://bbs.homecommunity.cn/app/zihaoApp.myListZihaoAppCmd"
	Remote_Apply_Publish_App_Url         string = "http://bbs.homecommunity.cn/app/zihaoApp.applyPublishZihaoAppCmd"
	Remote_Apply_Publish_App_Version_Url string = "http://bbs.homecommunity.cn/app/zihaoApp.applyPublishZihaoAppVersion"

	Remote_get_images_version_Url string = "http://bbs.homecommunity.cn/app/zihaoAppImagesVersion.listZihaoAppImagesVersion"

	Remote_Offline_App_Url string = "http://bbs.homecommunity.cn/app/zihaoApp.offlineZihaoApp"

	Remote_Save_Publisher   string = "http://bbs.homecommunity.cn/app/zihaoAppPublisher.saveZihaoAppPublisher"
	Remote_Update_Publisher string = "http://bbs.homecommunity.cn/app/zihaoAppPublisher.updateZihaoAppPublisher"
	Hc_cloud_app_id         string = "102021120963240004"
	Kafka_switch_on         string = "ON"
)

Variables

View Source
var (
	G_AppConfig AppConfig
	G_DBConfig  DBConfig
)

global var

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func InitConfig

func InitConfig()

func InitProp

func InitProp(filePath string)

初始化配置文件

Types

type AppConfig

type AppConfig struct {
	iris.Configuration `yaml:"Configuration"`
	Own                `yaml: "own"`
}

app

type DBConfig

type DBConfig struct {
	Redis struct {
		Addr     string `yaml:"addr"`
		Password string `yaml:"password"`
		DB       int    `yaml:"db"`
		PoolSize int    `yaml:"poolSize"`
	}
	Mysql struct {
		Dialect      string `yaml:"dialect"`
		User         string `yaml:"user"`
		Password     string `yaml:"password"`
		Host         string `yaml:"host"`
		Port         int    `yaml:"port"`
		Database     string `yaml:"database"`
		Charset      string `yaml:"charset"`
		ShowSql      bool   `yaml:"showSql"`
		LogLevel     string `yaml:"logLevel"`
		MaxOpenConns int    `yaml:"maxOpenConns"`
		MaxIdleConns int    `yaml:"maxIdleConns"`
	}
}

db

func (DBConfig) DBConnUrl

func (conf DBConfig) DBConnUrl() string

type Own

type Own struct {
	Separate            bool     `yaml:"separate"` // 是否前后端分离
	Port                int      `yaml:"port"`
	IgnoreURLs          []string `yaml:"ignore_urls,flow"`
	InterceptURLs       []string `yaml:"intercept_urls,flow"`
	JWTTimeout          int      `yaml:"jwt_timeout"`
	LogLevel            string   `yaml:"log_level"`
	Secret              string   `yaml:"secret"`
	WebsocketPool       int      `yaml:"websocket_pool"`
	Domain              string   `yaml:"domain"`
	Db                  string   `yaml:"db"`
	Cache               string   `yaml:"cache"`
	DataPath            string   `yaml:"data_path"`
	SqlitePath          string   `yaml:"sqlite_path"`
	ContainerScheduling string   `yaml:"container_scheduling"`
	KafkaIp             string   `yaml:"kafka_ip"`
	KafkaPort           string   `yaml:"kafka_port"`
	KafkaGroup          string   `yaml:"kafka_group"`
	KafkaTopic          string   `yaml:"kafka_topic"`
	KafkaSwitch         string   `yaml:"kafka_switch"`
	IpData              string   `yaml:"ip_data"`
	QqwryUrl            string   `yaml:"qqwry_url"`
	ServerIpUrl         string   `yaml:"server_ip_url"`
	GuacadAddr          string   `yaml:"guacad_addr"`
}

全局配置文件对应的结构体

type Properties

type Properties struct {
	// contains filtered or unexported fields
}
var Prop *Properties

func NewProperties

func NewProperties() *Properties

Create an empty property list.

func (*Properties) Load

func (p *Properties) Load(r io.Reader) error

从输入流读取属性列表。

Reads a property list (key and element pairs) from the input character stream in a simple line-oriented format.

func (*Properties) LoadFromFile

func (p *Properties) LoadFromFile(filePath string) error

从文件中读取属性列表。

Reads a property list from a file

func (*Properties) Property

func (p *Properties) Property(key string) (value string, isExist bool)

用指定的键在此属性列表中搜索属性。

Searches for the property with the specified key in this property list.

func (*Properties) PropertyNames

func (p *Properties) PropertyNames() []string

返回属性列表中所有键的枚举。

Returns an enumeration of all keys in the property list.

func (*Properties) PropertySlice

func (p *Properties) PropertySlice(key string) (values []string, isExist bool)

用指定的键在此属性列表中搜索属性,把","连接的多个属性转换为切片返回。

Search for attributes in this attribute list using the specified key to return multiple attributes connected by "," converted to slices.

func (*Properties) SetProperty

func (p *Properties) SetProperty(key, value string)

更新指定的键和属性,如果键不存在就新建。

Update the specified key and properties. If the key does not exist, create a new one.

func (*Properties) SetPropertySlice

func (p *Properties) SetPropertySlice(key string, values ...string)

为指定的键设置多个属性,把多个属性值转换成“,”连接的属性字符串。

Set multiple attributes for the specified key, converting multiple attribute values into a "," concatenated attribute string.

func (*Properties) Store

func (p *Properties) Store(w io.Writer) error

将属性列表写入输出流。

Writes this property list (key and element pairs) in this Properties table to the output stream in a format suitable for loading into a Properties table using the Load() method.

func (*Properties) StoreToFile

func (p *Properties) StoreToFile(filePath string) error

将属性列表写入文件。

Writes a list of property to a file.

Jump to

Keyboard shortcuts

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