Documentation ¶
Index ¶
- Constants
- func AddToken(appId string, app *App)
- func ComponentUrl(acsKey string, uri string) string
- func DefaultForm(w *multipart.Writer, field, filename string) error
- func DefaultUrl(acsKey string, uri string) string
- func DeleteToken(appId string) error
- func GetEmpty(tk Token, d data.D) (access.Token, error)
- type AliasId
- type App
- type AppMgr
- func (m *AppMgr) AddAlias(appId string, realId []string, aliasId AliasId) error
- func (m *AppMgr) AddToken(appId string, app *App)
- func (m *AppMgr) Clear(appId string, aliasId string, key string) error
- func (m *AppMgr) CreateChild(parent Token, info *Child, service Service) (Token, error)
- func (m *AppMgr) DeleteToken(appId string) error
- func (m *AppMgr) GetAliasId(appId string, realId string) (AliasId, error)
- func (m *AppMgr) GetToken(appId string) (Token, error)
- func (m *AppMgr) Read(appId string, aliasId string, key string) (string, error)
- func (m *AppMgr) SetAccessToken(appId string, aliasId string, acs access.Token) string
- func (m *AppMgr) Write(appId string, aliasId string, key string, v *validate.Data) error
- type AppOptions
- type AppOptionsFunc
- type Base
- type Child
- type Config
- type FlagUpdate
- type GetFunc
- type OptionsDataFunc
- type ResCode
- type ResToken
- type Service
- type Ticket
- type Token
- type VMap
Constants ¶
View Source
const ( NAccessToken = "access:token" /*自己本身的access token*/ NRefreshToken = "access:token:refresh" /*刷新自己本身access token */ NTicket = "get:ticket" NCreateChild = "create:child" NOauth2 = "oauth2" /*网页,个人授权*/ NOauthAccount = "oauth2:account" NOauth2App3 = "oauth2:app3" /*第三方应用授权,比把公众号授权给某个应用*/ NPreAuthCode = "app3:pre_auth_code" /* for 公众号授权给第三方,需要先获取一个 预授权码,然后调用前端授权页面进行授权,授权成功后会给一个授权码 "authorization_code" 然后用这个 authorization_code去调用 NOauth2App3,获取到 access token 相关信息 */ NAccessTokenProxy = "access:token:proxy" /* 进行代理,中转,从别的服务器获取token相关信息 */ )
Variables ¶
This section is empty.
Functions ¶
func ComponentUrl ¶
func DefaultUrl ¶
func DeleteToken ¶
Types ¶
type AppMgr ¶
type AppMgr struct {
// contains filtered or unexported fields
}
func (*AppMgr) CreateChild ¶
func (*AppMgr) DeleteToken ¶
func (*AppMgr) GetAliasId ¶
func (*AppMgr) SetAccessToken ¶
type AppOptions ¶
type AppOptions struct {
Config
}
type AppOptionsFunc ¶
type AppOptionsFunc func(opts *AppOptions)
type Base ¶ added in v0.3.2
type Base interface { GetAppId() string GetSecret() string GetAccessToken(options ...OptionsDataFunc) (string, error) }
type OptionsDataFunc ¶
type Token ¶
type Token interface { Parent() Token CreateChild(app *app.App, service Service) Token // GetUrl for request GetUrl(acsKey string, d data.D, uri string) string SetHead(acsKey string, h *http.Header) CreateForm(writer *multipart.Writer, form interface{}) error GetApp() *app.App GetAppId() string GetSecret() string GetAccessToken(options ...OptionsDataFunc) (string, error) SetAccessTokenWithAcs(acs access.Token) string SetAccessToken(tk string, expire int64) error ClearAccessToken() SetRefreshAccessToken(tk string, expire int64) error RefreshAccessToken(refToken string) (string, error) GetCode(name string) (string, error) ClearCode(name string) error SetCode(name, code string, expire int64) error // Execute data["appid"] Execute(cmd string, d data.D) (interface{}, error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.