Documentation ¶
Overview ¶
Package config provides for parse config file.
Index ¶
- Constants
- func Contains(obj interface{}, target interface{}) (bool, error)
- func DeepCopy(dst, src interface{}) error
- func GetKVInRelaPath(path string) map[string]string
- func GetSetting(settings map[string]string, key string) (string, bool)
- func GetWDPath() string
- func IsDirExists(path string) bool
- func IsFileExists(path string) bool
- func IsStringNum(a string) bool
- func JsonpToJson(json string) string
- func MakeHash(s string) string
- func MapDictSortToStr(dict map[string]string) (ret string)
- func Md5(str string) (ret string)
- func PutError(err error)
- func XML2mapstr(xmldoc string) map[string]string
- type Config
- func (self *Config) Clear()
- func (self *Config) GlobalContent() map[string]string
- func (self *Config) GlobalGet(key string) string
- func (self *Config) GlobalGetDeadline(key string) time.Time
- func (self *Config) GlobalGetDuration(key string) time.Duration
- func (self *Config) GlobalGetInt(key string) int
- func (self *Config) GlobalGetInt64(key string) int64
- func (self *Config) GlobalGetSlice(key string, separator string) []string
- func (self *Config) GlobalGetSliceInt(key string, separator string) []int
- func (self *Config) GlobalHas(key string) bool
- func (self *Config) GlobalSet(key string, value string)
- func (self *Config) HasSection(section string) bool
- func (self *Config) Load(configFile string) *Config
- func (self *Config) LoadString(s string) error
- func (self *Config) Save(configFile string) error
- func (self *Config) SectionContent(section string) map[string]string
- func (self *Config) SectionContents() map[string]map[string]string
- func (self *Config) SectionGet(section string, key string) string
- func (self *Config) SectionGetDuration(section string, key string) time.Duration
- func (self *Config) SectionGetInt(section string, key string) int
- func (self *Config) SectionGetSlice(section string, key string, separator string) []string
- func (self *Config) SectionHas(section string, key string) bool
- func (self *Config) SectionSet(section string, key string, value string)
- func (self *Config) Sections() []string
- func (self *Config) String() string
- func (self *Config) StringWithMeta() string
- type DLoad
- type GoroutinePool
- type HandleInterface
- type Web
- type WebHandler
- func (self *WebHandler) Closed() bool
- func (self *WebHandler) Connect(w http.ResponseWriter, r *http.Request, web *Web)
- func (self *WebHandler) Delete(w http.ResponseWriter, r *http.Request, web *Web)
- func (self *WebHandler) Finish(w http.ResponseWriter, r *http.Request, web *Web)
- func (self *WebHandler) Get(w http.ResponseWriter, r *http.Request, web *Web)
- func (self *WebHandler) Head(w http.ResponseWriter, r *http.Request, web *Web)
- func (self *WebHandler) Options(w http.ResponseWriter, r *http.Request, web *Web)
- func (self *WebHandler) Post(w http.ResponseWriter, r *http.Request, web *Web)
- func (self *WebHandler) Prepare(w http.ResponseWriter, r *http.Request, web *Web)
- func (self *WebHandler) Put(w http.ResponseWriter, r *http.Request, web *Web)
- func (self *WebHandler) StopRun()
Constants ¶
View Source
const ( BUF0 = 0 BUF1 = 1 )
Variables ¶
This section is empty.
Functions ¶
func GetKVInRelaPath ¶
获取绝对路径或相对路径中的参数,返回参数字典 /Book/ShowBookList.aspx?tclassid=3&page=1
func IsDirExists ¶
判断目录是否存在 The IsDirExists judges path is directory or not.
func IsFileExists ¶
判断文件是否存在 The IsFileExists judges path is file or not.
func IsStringNum ¶
判断字符串是否为数字字符串 The IsNum judges string is number or not.
func JsonpToJson ¶
将Jsonp转化为Json JsonpToJson modify jsonp string to json string Example: forbar({a:"1",b:2}) to {"a":"1","b":2}
func MapDictSortToStr ¶
func XML2mapstr ¶
将xml转化为map[string]string simple xml to string support utf8
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) GlobalContent ¶
func (*Config) GlobalGetInt ¶
func (*Config) GlobalGetInt64 ¶
func (*Config) GlobalGetSlice ¶
func (*Config) GlobalGetSliceInt ¶
func (*Config) HasSection ¶
func (*Config) LoadString ¶
func (*Config) SectionContent ¶
func (*Config) SectionGetDuration ¶
func (*Config) SectionGetSlice ¶
func (*Config) SectionSet ¶
func (*Config) StringWithMeta ¶
type GoroutinePool ¶
type GoroutinePool struct { Queue chan func() error Number int Total int // contains filtered or unexported fields }
func (*GoroutinePool) SetFinishCallback ¶
func (self *GoroutinePool) SetFinishCallback(callback func())
设置结束回调
type HandleInterface ¶
type HandleInterface interface { Prepare(w http.ResponseWriter, r *http.Request, web *Web) Get(w http.ResponseWriter, r *http.Request, web *Web) Put(w http.ResponseWriter, r *http.Request, web *Web) Post(w http.ResponseWriter, r *http.Request, web *Web) Options(w http.ResponseWriter, r *http.Request, web *Web) Head(w http.ResponseWriter, r *http.Request, web *Web) Delete(w http.ResponseWriter, r *http.Request, web *Web) Connect(w http.ResponseWriter, r *http.Request, web *Web) Finish(w http.ResponseWriter, r *http.Request, web *Web) Closed() bool }
type WebHandler ¶
type WebHandler struct {
// contains filtered or unexported fields
}
所有http处理类都继承此类
func (*WebHandler) Closed ¶
func (self *WebHandler) Closed() bool
func (*WebHandler) Connect ¶
func (self *WebHandler) Connect(w http.ResponseWriter, r *http.Request, web *Web)
func (*WebHandler) Delete ¶
func (self *WebHandler) Delete(w http.ResponseWriter, r *http.Request, web *Web)
func (*WebHandler) Finish ¶
func (self *WebHandler) Finish(w http.ResponseWriter, r *http.Request, web *Web)
func (*WebHandler) Get ¶
func (self *WebHandler) Get(w http.ResponseWriter, r *http.Request, web *Web)
func (*WebHandler) Head ¶
func (self *WebHandler) Head(w http.ResponseWriter, r *http.Request, web *Web)
func (*WebHandler) Options ¶
func (self *WebHandler) Options(w http.ResponseWriter, r *http.Request, web *Web)
func (*WebHandler) Post ¶
func (self *WebHandler) Post(w http.ResponseWriter, r *http.Request, web *Web)
func (*WebHandler) Prepare ¶
func (self *WebHandler) Prepare(w http.ResponseWriter, r *http.Request, web *Web)
func (*WebHandler) Put ¶
func (self *WebHandler) Put(w http.ResponseWriter, r *http.Request, web *Web)
func (*WebHandler) StopRun ¶
func (self *WebHandler) StopRun()
Click to show internal directories.
Click to hide internal directories.