Documentation ¶
Index ¶
- func LoadFacebook(config ConfigOAuth2) *authFacebook
- func LoadGoogle(config ConfigOAuth2) *authGoogle
- func LoadTwitter(config ConfigOAuth1) *authTwitter
- func NewUserModel() interface{}
- func NewUserModelPointer() interface{}
- func NewUserTokenModel() interface{}
- func NewUserTokenModelPointer() interface{}
- type AccessToken
- type AccountInformation
- type Auth
- func (a *Auth) Auth(vendor AuthVendor) AuthInstance
- func (a *Auth) AuthCodeUrl(vendor AuthVendor) (url, token, secret string)
- func (a *Auth) CookieKeyName() string
- func (a *Auth) MasterKey() string
- func (a *Auth) UserInfoExchange(vendor AuthVendor, code, token, secret string) (*AccessToken, *AccountInformation, error)
- type AuthInstance
- type AuthVendor
- type Config
- type ConfigOAuth1
- type ConfigOAuth2
- type TweetInstance
- type TweetModel
- type UserModel
- type UserTokenModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadFacebook ¶
func LoadFacebook(config ConfigOAuth2) *authFacebook
func LoadGoogle ¶
func LoadGoogle(config ConfigOAuth2) *authGoogle
func LoadTwitter ¶
func LoadTwitter(config ConfigOAuth1) *authTwitter
func NewUserModel ¶
func NewUserModel() interface{}
func NewUserModelPointer ¶
func NewUserModelPointer() interface{}
func NewUserTokenModel ¶
func NewUserTokenModel() interface{}
func NewUserTokenModelPointer ¶
func NewUserTokenModelPointer() interface{}
Types ¶
type AccessToken ¶
type AccessToken struct { AccessToken string TokenSecret string TokenType string RefreshToken string Expiry time.Time }
--[ Access Token Model ]--------
type AccountInformation ¶
--[ Access Token Model ]--------
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func (*Auth) Auth ¶
func (a *Auth) Auth(vendor AuthVendor) AuthInstance
func (*Auth) AuthCodeUrl ¶
func (a *Auth) AuthCodeUrl(vendor AuthVendor) (url, token, secret string)
func (*Auth) CookieKeyName ¶
func (*Auth) UserInfoExchange ¶
func (a *Auth) UserInfoExchange(vendor AuthVendor, code, token, secret string) (*AccessToken, *AccountInformation, error)
type AuthInstance ¶
type AuthInstance interface { AuthCodeUrl() (url, token, secret string) TokenExchange(code, token, secret string) (*AccessToken, error) UserInfo(*AccessToken) (*AccountInformation, error) }
type AuthVendor ¶
type AuthVendor int
const ( VENDOR_GOOGLE AuthVendor = iota VENDOR_TWITTER VENDOR_FACEBOOK )
func AuthVendorCode ¶
func AuthVendorCode(vendor string) (AuthVendor, error)
func (AuthVendor) String ¶
func (av AuthVendor) String() string
type Config ¶
type Config struct { MasterKey string `json:"master_key"` CookieKeyName string `json:"cookie_key_name"` Google ConfigOAuth2 `json:"google"` Twitter ConfigOAuth1 `json:"twitter"` Facebook ConfigOAuth2 `json:"facebook"` }
type ConfigOAuth1 ¶
type ConfigOAuth1 struct { Vendor string `json:"vendor"` ConsumerKey string `json:"consumer_key"` ConsumerSecret string `json:"consumer_secret"` RedirectUrl string `json:"redirect_url"` AuthorizeTokenUrl string `json:"authorize_token_url"` RequestTokenUrl string `json:"request_token_url"` AccessTokenUrl string `json:"access_token_url"` }
type ConfigOAuth2 ¶
type TweetInstance ¶
type TweetInstance interface {
Tweet(accessToken *AccessToken, tweet *TweetModel) error
}
type TweetModel ¶
type UserModel ¶
type UserModel struct { Id int64 `db_table:"users"` CreatedAt time.Time UpdatedAt time.Time Locked bool Enabled bool Name string Email string EmailCanonical string PasswordSalt string Password string Thumbnail string Serial string DeletedAt time.Time `db_delete:"true"` }
--[ User Model ]--------
type UserTokenModel ¶
type UserTokenModel struct { Id int64 `db_table:"user_tokens"` CreatedAt time.Time UpdatedAt time.Time UserId int64 Vendor string AccessToken string TokenSecret string Expiry time.Time RefreshToken string TokenType string AccountId string Name string Thumbnail string DeletedAt time.Time `db_delete:"true"` }
--[ User Token Model ]--------
func (*UserTokenModel) GetId ¶
func (m *UserTokenModel) GetId() int64
func (*UserTokenModel) SetId ¶
func (m *UserTokenModel) SetId(id int64)
func (*UserTokenModel) SqlValues ¶
func (m *UserTokenModel) SqlValues(sqlType model551.SqlType) []interface{}
Click to show internal directories.
Click to hide internal directories.