Documentation
¶
Index ¶
- func GetStringFromMap(rawData interface{}, field string) (string, bool)
- type AuthAdaptorOauth
- func (a AuthAdaptorOauth) Authenticate(_ string, data map[string]interface{}) (string, apperror.Error)
- func (item *AuthAdaptorOauth) Backend() db.Backend
- func (a AuthAdaptorOauth) Name() string
- func (a *AuthAdaptorOauth) RegisterService(service Service)
- func (a *AuthAdaptorOauth) RegisterUser(user kit.User, data map[string]interface{}) (kit.AuthItem, apperror.Error)
- func (item *AuthAdaptorOauth) SetBackend(b db.Backend)
- type AuthItemOauth
- type BaseService
- type Client
- type Facebook
- type Service
- type TokenClient
- type UserData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetStringFromMap ¶
Types ¶
type AuthAdaptorOauth ¶
type AuthAdaptorOauth struct {
// contains filtered or unexported fields
}
func NewAdaptor ¶
func NewAdaptor() *AuthAdaptorOauth
func (AuthAdaptorOauth) Authenticate ¶
func (a AuthAdaptorOauth) Authenticate(_ string, data map[string]interface{}) (string, apperror.Error)
func (*AuthAdaptorOauth) Backend ¶
func (item *AuthAdaptorOauth) Backend() db.Backend
func (AuthAdaptorOauth) Name ¶
func (a AuthAdaptorOauth) Name() string
func (*AuthAdaptorOauth) RegisterService ¶
func (a *AuthAdaptorOauth) RegisterService(service Service)
func (*AuthAdaptorOauth) RegisterUser ¶
func (*AuthAdaptorOauth) SetBackend ¶
func (item *AuthAdaptorOauth) SetBackend(b db.Backend)
type AuthItemOauth ¶
type AuthItemOauth struct { db.StrIdModel Service string `db:"required;max:100;"` UserId string `db:"required;max:150;"` ExternalUserId string `db:"required;max:100;"` Token string `db:"required;max:500;"` }
func (*AuthItemOauth) Collection ¶
func (item *AuthItemOauth) Collection() string
func (*AuthItemOauth) GetUser ¶
func (item *AuthItemOauth) GetUser() kit.User
func (*AuthItemOauth) GetUserId ¶
func (item *AuthItemOauth) GetUserId() interface{}
func (*AuthItemOauth) SetUser ¶
func (item *AuthItemOauth) SetUser(u kit.User)
func (*AuthItemOauth) SetUserId ¶
func (item *AuthItemOauth) SetUserId(id interface{}) error
type BaseService ¶
type BaseService struct { AuthUrl string RedirectUrl string TokenUrl string EndpointUrl string ClientId string ClientSecret string }
func (*BaseService) GetAuthUrl ¶
func (s *BaseService) GetAuthUrl() string
func (*BaseService) GetClientId ¶
func (s *BaseService) GetClientId() string
func (*BaseService) GetClientSecrect ¶
func (s *BaseService) GetClientSecrect() string
func (*BaseService) GetEndpointUrl ¶
func (s *BaseService) GetEndpointUrl() string
func (*BaseService) GetRedirectUrl ¶
func (s *BaseService) GetRedirectUrl() string
func (*BaseService) GetTokenUrl ¶
func (s *BaseService) GetTokenUrl() string
type Facebook ¶
type Facebook struct {
BaseService
}
func NewFacebook ¶
func (*Facebook) GetExchangeUrl ¶
func (*Facebook) GetUserData ¶
type Service ¶
type Service interface { Name() string GetClientId() string GetClientSecrect() string GetAuthUrl() string GetRedirectUrl() string GetTokenUrl() string GetExchangeUrl(token string) string GetEndpointUrl() string Exchange(token string) (string, apperror.Error) GetClient(token string) Client GetUserData(token string) (*UserData, apperror.Error) }
type TokenClient ¶
type TokenClient struct {
// contains filtered or unexported fields
}
func NewTokenClient ¶
func NewTokenClient(service Service, token string) *TokenClient
Click to show internal directories.
Click to hide internal directories.