Documentation ¶
Index ¶
- Constants
- Variables
- func AESDecode(enmsg, key string) (string, error)
- func AESEncode(msg, key string) (string, error)
- func Accept_Encoding(r *http.Request) string
- func Cmmand_Linux(c string, args []string) ([]byte, string, error)
- func ConvertUTF8(src []byte) ([]byte, error)
- func Daemon(nochdir, noclose int) (int, error)
- func DateToStr(time time.Time) string
- func Exists(p string) bool
- func Format_Date(time time.Time, format string) string
- func GetCharset(charset string) encoding.Encoding
- func Get_Bin_Dir() string
- func Get_Bin_Path() string
- func Get_File_Size(fileSize int64) string
- func Get_Project_Dir() string
- func Gzip_Binary(b []byte, w http.ResponseWriter, r *http.Request)
- func Gzip_File(file_path string, w http.ResponseWriter, r *http.Request)
- func Gzip_Html(b io.Reader, w http.ResponseWriter, r *http.Request)
- func IsDir(p string) bool
- func Load_Mime(path string) error
- func Log_Debug(err ...interface{})
- func Log_Err(err ...interface{})
- func Log_Fatal(err ...interface{})
- func Log_Info(err ...interface{})
- func Log_Warn(err ...interface{})
- func Log_level() int
- func MkdirByFile(file string) error
- func Path_Handle(path string, pathParams map[string]string) (string, error)
- func SetLogger(l *log.Logger)
- func Set_log_level(l int)
- func Sign_Handle(s string, iden string) string
- func ToStr(value interface{}) (s string)
- func WritePidFile(file, pid string) error
- type Conf
- type DB_Conf
- type HttpClient
- type MySQL
- func (d *MySQL) DB_Open() (*MySQL, error)
- func (d *MySQL) Delete(s string) (n int64, err error)
- func (d *MySQL) Exec(s string, args ...interface{}) (n int64, err error)
- func (d *MySQL) Query(obj interface{}, s string) ([]interface{}, error)
- func (d *MySQL) QueryCount(s string) (int, error)
- func (d *MySQL) QueryOne(obj interface{}, s string) (interface{}, error)
- type SQLUtils
- func (s *SQLUtils) AsName(n string) *SQLUtils
- func (s *SQLUtils) Delete() string
- func (s *SQLUtils) Insert() (string, []interface{})
- func (s *SQLUtils) Limit(index int, num int) *SQLUtils
- func (s *SQLUtils) OrderBy(name string, sort string) *SQLUtils
- func (s *SQLUtils) QueryAll() string
- func (s *SQLUtils) QueryByConcat() string
- func (s *SQLUtils) QueryCount() string
- func (s *SQLUtils) QueryCountByConcat() string
- func (s *SQLUtils) RegisterStruct(i interface{}) *SQLUtils
- func (s *SQLUtils) SetPK(pk string) *SQLUtils
- func (s *SQLUtils) Update() (string, []interface{})
- func (s *SQLUtils) WhereAnd(name string, condition string, value string) *SQLUtils
- func (s *SQLUtils) WhereConcat(value string, field ...string) *SQLUtils
- func (s *SQLUtils) WhereOr(name string, condition string, value string) *SQLUtils
- type StringUtils
- func (s StringUtils) Base64Decode() (string, error)
- func (s StringUtils) Base64Encode() string
- func (s StringUtils) Bool() (bool, error)
- func (s *StringUtils) Clear()
- func (s StringUtils) ContainsBool(sep string) bool
- func (s StringUtils) ContainsNum() (bool, error)
- func (s StringUtils) Exist() bool
- func (s StringUtils) Float32() (float32, error)
- func (s StringUtils) Float64() (float64, error)
- func (s StringUtils) GenerateRandStr32() string
- func (s StringUtils) HMAC_SHA1(key string) string
- func (s StringUtils) HMAC_SHA256(key string) string
- func (s StringUtils) HMAC_SHA512(key string) string
- func (s StringUtils) Int() (int, error)
- func (s StringUtils) Int16() (int16, error)
- func (s StringUtils) Int32() (int32, error)
- func (s StringUtils) Int64() (int64, error)
- func (s StringUtils) Int8() (int8, error)
- func (s StringUtils) MD5() string
- func (s StringUtils) RegexpSQLSgin() (bool, error)
- func (s StringUtils) RegexpSQLVal() (bool, error)
- func (s StringUtils) SHA1() string
- func (s StringUtils) SHA256() string
- func (s StringUtils) SHA512() string
- func (s *StringUtils) Set(v string)
- func (s StringUtils) String() string
- func (s StringUtils) ToTitleLower() string
- func (s StringUtils) ToTitleUpper() string
- func (s StringUtils) UUID() (string, error)
- func (s StringUtils) UUID16() (string, error)
- func (s StringUtils) Uint() (uint, error)
- func (s StringUtils) Uint16() (uint16, error)
- func (s StringUtils) Uint32() (uint32, error)
- func (s StringUtils) Uint64() (uint64, error)
- func (s StringUtils) Uint8() (uint8, error)
- type WS_Conf
Constants ¶
View Source
const ( Agent_prefix = "Agent." Server_prefix = "RPC_Server." PathSeparator = string(os.PathSeparator) DevNull = os.DevNull OS_MacOS = "darwin" OS_FreeBSD = "freebsd" OS_Linux = "linux" OS_Windows = "windows" Arch_AMD64 = "amd64" Arch_386 = "386" ChanLen = 500 CONNECT = "CONNECT" DELETE = "DELETE" GET = "GET" HEAD = "HEAD" OPTIONS = "OPTIONS" PATCH = "PATCH" POST = "POST" PUT = "PUT" TRACE = "TRACE" Zip_gZip = "gzip" Zip_Deflate = "deflate" GZip_Mini_Size = 1024 Log_file_suffix = ".log" )
View Source
const ( LevelDebug = iota LevelFatal LevelError LevelWarn LevelInfo )
Variables ¶
View Source
var ( LogDir = Get_Project_Dir() + PathSeparator + "log" ConfDir = Get_Project_Dir() + PathSeparator + "conf" PidPath = LogDir + PathSeparator + "apibox.pid" MimePath = ConfDir + PathSeparator + "mime.types" ConfPath = ConfDir + PathSeparator + "conf.json" )
View Source
var (
ABC_Conf, _ = Get_Conf()
)
Functions ¶
func Accept_Encoding ¶
func ConvertUTF8 ¶
func GetCharset ¶
func Get_Bin_Dir ¶
func Get_Bin_Dir() string
func Get_Bin_Path ¶
func Get_Bin_Path() string
func Get_File_Size ¶
func Get_Project_Dir ¶
func Get_Project_Dir() string
func Gzip_Binary ¶
func Gzip_Binary(b []byte, w http.ResponseWriter, r *http.Request)
func MkdirByFile ¶
func Set_log_level ¶
func Set_log_level(l int)
func Sign_Handle ¶
func WritePidFile ¶
Types ¶
type Conf ¶
type HttpClient ¶
type HttpClient struct{}
type SQLUtils ¶
type SQLUtils struct {
// contains filtered or unexported fields
}
func (*SQLUtils) QueryByConcat ¶
func (*SQLUtils) QueryCount ¶
func (*SQLUtils) QueryCountByConcat ¶
func (*SQLUtils) RegisterStruct ¶
func (*SQLUtils) WhereConcat ¶
type StringUtils ¶
type StringUtils string
func (StringUtils) Base64Decode ¶
func (s StringUtils) Base64Decode() (string, error)
func (StringUtils) Base64Encode ¶
func (s StringUtils) Base64Encode() string
func (StringUtils) Bool ¶
func (s StringUtils) Bool() (bool, error)
func (*StringUtils) Clear ¶
func (s *StringUtils) Clear()
func (StringUtils) ContainsBool ¶
func (s StringUtils) ContainsBool(sep string) bool
func (StringUtils) ContainsNum ¶
func (s StringUtils) ContainsNum() (bool, error)
func (StringUtils) Exist ¶
func (s StringUtils) Exist() bool
func (StringUtils) Float32 ¶
func (s StringUtils) Float32() (float32, error)
func (StringUtils) Float64 ¶
func (s StringUtils) Float64() (float64, error)
func (StringUtils) GenerateRandStr32 ¶
func (s StringUtils) GenerateRandStr32() string
func (StringUtils) HMAC_SHA1 ¶
func (s StringUtils) HMAC_SHA1(key string) string
func (StringUtils) HMAC_SHA256 ¶
func (s StringUtils) HMAC_SHA256(key string) string
func (StringUtils) HMAC_SHA512 ¶
func (s StringUtils) HMAC_SHA512(key string) string
func (StringUtils) Int ¶
func (s StringUtils) Int() (int, error)
func (StringUtils) Int16 ¶
func (s StringUtils) Int16() (int16, error)
func (StringUtils) Int32 ¶
func (s StringUtils) Int32() (int32, error)
func (StringUtils) Int64 ¶
func (s StringUtils) Int64() (int64, error)
func (StringUtils) Int8 ¶
func (s StringUtils) Int8() (int8, error)
func (StringUtils) MD5 ¶
func (s StringUtils) MD5() string
func (StringUtils) RegexpSQLSgin ¶
func (s StringUtils) RegexpSQLSgin() (bool, error)
func (StringUtils) RegexpSQLVal ¶
func (s StringUtils) RegexpSQLVal() (bool, error)
func (StringUtils) SHA1 ¶
func (s StringUtils) SHA1() string
func (StringUtils) SHA256 ¶
func (s StringUtils) SHA256() string
func (StringUtils) SHA512 ¶
func (s StringUtils) SHA512() string
func (*StringUtils) Set ¶
func (s *StringUtils) Set(v string)
func (StringUtils) String ¶
func (s StringUtils) String() string
func (StringUtils) ToTitleLower ¶
func (s StringUtils) ToTitleLower() string
func (StringUtils) ToTitleUpper ¶
func (s StringUtils) ToTitleUpper() string
func (StringUtils) UUID ¶
func (s StringUtils) UUID() (string, error)
func (StringUtils) UUID16 ¶
func (s StringUtils) UUID16() (string, error)
func (StringUtils) Uint ¶
func (s StringUtils) Uint() (uint, error)
func (StringUtils) Uint16 ¶
func (s StringUtils) Uint16() (uint16, error)
func (StringUtils) Uint32 ¶
func (s StringUtils) Uint32() (uint32, error)
func (StringUtils) Uint64 ¶
func (s StringUtils) Uint64() (uint64, error)
func (StringUtils) Uint8 ¶
func (s StringUtils) Uint8() (uint8, error)
type WS_Conf ¶
type WS_Conf struct { Addr string `json:"addr" xml:"addr"` TlsAddr string `json:"tls_addr" xml:"tls_addr"` TlsUrl string `json:"tls_url" xml:"tls_url"` SessionTimeOut int `json:"session_timeout" xml:"session_timeout"` StaticDir string `json:"static_dir" xml:"static_dir"` TemplateDir string `json:"template_dir" xml:"template_dir"` TemplateSuffix string `json:"template_suffix" xml:"template_suffix"` EnableJSONP bool `json:"enable_jsonp" xml:"enable_jsonp"` JSONPParam string `json:"jsonp_param" xml:"jsonp_param"` EnableTLS bool `json:"enable_tls" xml:"enable_tls"` CorsWhiteList string `json:"cors_white_list" xml:"cors_white_list"` EnableFcgi bool `json:"enable_fcgi" xml:"enable_fcgi"` TlsCert string `json:"tls_cert,omitempty" xml:"tls_cert,omitempty"` TlsKey string `json:"tls_key,omitempty" xml:"tls_key,omitempty"` Daemon bool `json:"daemon,omitempty" xml:"daemon,omitempty"` UrlTimeout string `json:"url_timeout,omitempty" xml:"url_timeout,omitempty"` LogLevel string `json:"log_level,omitempty" xml:"log_level,omitempty"` }
Click to show internal directories.
Click to hide internal directories.