Documentation
¶
Index ¶
- Variables
- func AsRawData(resp *sdk_options.Response) *echo.RawData
- func Decrypt(decrypted string, secret string) string
- func Encrypt(raw string, secret string) string
- func GetCodeAndMsgFromAPIData(data map[string]any) (code, msg any)
- func GetOAuthProviderTitle(list []*OAuthProvider, name string) string
- func MakeFormValueGetter(ctx echo.Context) func(string) string
- type AppInfo
- type AppInfoFromAccount
- type AppInfoFromOpenApp
- type AppInfoGetter
- type OAuthOption
- type OAuthProvider
- type OAuthProvidersResponse
- type Options
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var OAuthOptionsCreater = func(ctx echo.Context, typ Type, generators ...sdk_options.URLValuesGenerator) OAuthOption { return NewOptions(ctx, TypeOAuth, generators...) }
Functions ¶
func GetOAuthProviderTitle ¶
func GetOAuthProviderTitle(list []*OAuthProvider, name string) string
Types ¶
type AppInfoFromAccount ¶
type AppInfoFromAccount struct {
Account *dbschema.OfficialCommonApiAccount
URLPrefix string
}
func (AppInfoFromAccount) GetApiEndpoint ¶
func (a AppInfoFromAccount) GetApiEndpoint() string
func (AppInfoFromAccount) GetAppID ¶
func (a AppInfoFromAccount) GetAppID() string
func (AppInfoFromAccount) GetAppSecret ¶
func (a AppInfoFromAccount) GetAppSecret() string
type AppInfoFromOpenApp ¶
func (AppInfoFromOpenApp) GetApiEndpoint ¶
func (a AppInfoFromOpenApp) GetApiEndpoint() string
func (AppInfoFromOpenApp) GetAppID ¶
func (a AppInfoFromOpenApp) GetAppID() string
func (AppInfoFromOpenApp) GetAppSecret ¶
func (a AppInfoFromOpenApp) GetAppSecret() string
type AppInfoGetter ¶
var AppInfoDefaultGetter AppInfoGetter = func(ctx echo.Context, cond db.Compound) (appInfo AppInfo, err error) { err = ctx.NewError(code.Unsupported, `尚未设置App信息获取方式`) return }
type OAuthOption ¶
type OAuthProvider ¶
type OAuthProvider struct {
Name string `json:"name" xml:"name"`
English string `json:"english" xml:"english"`
IconClass string `json:"iconClass" xml:"iconClass"`
IconImage string `json:"iconImage" xml:"iconImage"`
WrapClass string `json:"wrapClass" xml:"wrapClass"`
LoginURL string `json:"loginURL" xml:"loginURL"`
}
func GetOAuthProvider ¶
func GetOAuthProvider(list []*OAuthProvider, name string) *OAuthProvider
func OAuthProviders ¶
func OAuthProviders(ctx echo.Context) ([]*OAuthProvider, error)
func OAuthProvidersFrom ¶
func OAuthProvidersFrom(accounts []oauth2.Account) []*OAuthProvider
type OAuthProvidersResponse ¶
type OAuthProvidersResponse struct {
List []*OAuthProvider `json:"list"`
}
type Options ¶
type Options struct {
*sdk_options.Options
// contains filtered or unexported fields
}
func NewOptions ¶
func NewOptions(ctx echo.Context, typ Type, generators ...sdk_options.URLValuesGenerator) *Options
func (*Options) ApplySetting ¶
func (*Options) GetAccountID ¶
func (*Options) SetAppInfoGetter ¶
func (o *Options) SetAppInfoGetter(appInfoGetter AppInfoGetter) *Options
type Type ¶
type Type = sdk_options.Type
const ( // TypeOAuth 社区登录类型 TypeOAuth Type = sdk_options.TypeOAuth // TypePayment 支付类型 TypePayment Type = sdk_options.TypePayment )
Click to show internal directories.
Click to hide internal directories.