Documentation
¶
Index ¶
Constants ¶
View Source
const ( ECodeOK ErrCode = 20000 ECodeRedirect = 30200 ECodeBadRequest = 40000 ECodeForbidden = 40300 ECodeNotFound = 40400 ECodeInternal = 50000 ECode3rdPartyAuthFailed = 50300 ECodeInvalidUsername = 60001 ECodeInvalidNickname = 60002 ECodeInvalidPassword = 60003 ECodeMobileUserNotFound = 60101 ECodeMobileUserBadCode = 60102 ECodeMobileUserBadToken = 60103 ECodeMobileUserAlreadyExists = 60104 )
View Source
const ( RoleAppUser Role = 100 RoleWebUser = 101 RoleWebAdmin = 200 )
View Source
const AnonymousId = 6666
View Source
const CustomConfVerHeaderName = "X-Appgo-Conf-Version"
View Source
const CustomTokenHeaderName = "X-Appgo-Token"
View Source
const CustomVersionHeaderName = "X-Appgo-Api-Version"
View Source
const InternalTestId = 7777
View Source
const InternalTestToken = "sjadfjlksadfjkljfwoeifshgsdhgsldfjf"
Variables ¶
View Source
var Conf struct { DevMode bool LogLevel log.Level RootKey string TemplatePath string CdnDomain string Pprof struct { Enable bool Port string } Mysql []struct { Host string Port string User string Password string DbName string Charset string MaxConn int MaxLifetime int } Redis struct { Host string Port string Password string MaxIdle int IdleTimeout int } Negroni struct { Port string GZip bool } Cors struct { AllowedOrigins string AllowedMethods string AllowedHeaders string OptionsPassthrough bool Debug bool } TokenLifetime struct { AppUser int WebUser int WebAdmin int } Weixin struct { AppId string Secret string } WeixinJssdk struct { AppId string Secret string } Weibo struct { AppId string Secret string RedirectUrl string } Qq struct { AppId string } Qiniu struct { AccessKey string Secret string Bucket string Domain string DefaultExpires int UseHttps bool } Umeng struct { Android struct { AppKey string AppMasterSecret string } Ios struct { AppKey string AppMasterSecret string } } Leancloud struct { AppId string AppKey string AndroidAction string ExpirationInterval int } Graylog struct { Ip string Port string Facility string } Prometheus struct { Enable bool Port string } }
View Source
var (
RootDir string
)
Functions ¶
func InitLogHooks ¶
func InitLogHooks(skip int)
func SetLogFile ¶
Types ¶
type ApiError ¶
func ApiErrFromGoErr ¶
func NewApiErrWithCode ¶
func NewApiErrWithMsg ¶
func (*ApiError) HttpError ¶
func (e *ApiError) HttpError(w http.ResponseWriter)
type DummyInput ¶
type DummyInput struct{}
type FileInfoHook ¶
type FileInfoHook struct {
// contains filtered or unexported fields
}
func (*FileInfoHook) Levels ¶
func (hook *FileInfoHook) Levels() []logrus.Level
type MobileMsgSender ¶
type MobileMsgSender interface {
SendMobileCode(mobile string, template SmsTemplate, code string) error
}
type SmsTemplate ¶
type SmsTemplate int
const ( SmsTemplateRegister SmsTemplate SmsTemplatePwReset SmsTemplateSetMobile )
Click to show internal directories.
Click to hide internal directories.