Documentation ¶
Index ¶
- func NewAccessTokenRepository() domain.IAccessTokenRepository
- func NewAccountRepository() domain.IAccountRepository
- func NewCodeRepository() domain.ICodeRepository
- func NewGithubRepository(options ...GithubOption) domain.IGithubRepository
- func NewPrivateTelInfoRepository() domain.IPrivateTelInfoRepository
- type AccessTokenRepository
- type AccountRepository
- func (ar *AccountRepository) DelByUserIdFromCache(ctx context.Context, userId int) error
- func (ar *AccountRepository) DeleteFromCache(ctx context.Context, openid string) error
- func (ar *AccountRepository) GetByUserID(ctx context.Context, userId int) ([]domain.Account, error)
- func (ar *AccountRepository) GetOneByOpenid(ctx context.Context, openid string) (*domain.Account, error)
- func (ar *AccountRepository) Save(_ context.Context, account *domain.Account, privateTel *domain.PrivateTelInfo, ...) error
- func (ar *AccountRepository) SaveSns(ctx context.Context, account *domain.Account, profile *domain.Profile, ...) error
- type CodeRepository
- func (cr *CodeRepository) GetByTel(ctx context.Context, tel, nationCode string, purpose int) (*domain.Code, error)
- func (cr *CodeRepository) GetByTelAndCode(ctx context.Context, tel, nationCode, code string, purpose int) (*domain.Code, error)
- func (cr *CodeRepository) Save(ctx context.Context, code *domain.Code) error
- func (cr *CodeRepository) Update(ctx context.Context, code *domain.Code) error
- type GithubAccessTokenReq
- type GithubErrResp
- type GithubOption
- type GithubRepository
- type GithubUserErrResp
- type GithubUserResp
- type Plan
- type PrivateTelInfoRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAccessTokenRepository ¶
func NewAccessTokenRepository() domain.IAccessTokenRepository
func NewAccountRepository ¶
func NewAccountRepository() domain.IAccountRepository
func NewCodeRepository ¶
func NewCodeRepository() domain.ICodeRepository
func NewGithubRepository ¶
func NewGithubRepository(options ...GithubOption) domain.IGithubRepository
func NewPrivateTelInfoRepository ¶
func NewPrivateTelInfoRepository() domain.IPrivateTelInfoRepository
Types ¶
type AccessTokenRepository ¶
type AccessTokenRepository struct { }
func (*AccessTokenRepository) DelAccessToken ¶
func (atRepo *AccessTokenRepository) DelAccessToken(ctx context.Context, token string) error
func (*AccessTokenRepository) GetAccessToken ¶
func (*AccessTokenRepository) SetAccessToken ¶
type AccountRepository ¶
type AccountRepository struct { }
func (*AccountRepository) DelByUserIdFromCache ¶
func (ar *AccountRepository) DelByUserIdFromCache(ctx context.Context, userId int) error
func (*AccountRepository) DeleteFromCache ¶
func (ar *AccountRepository) DeleteFromCache(ctx context.Context, openid string) error
func (*AccountRepository) GetByUserID ¶
func (*AccountRepository) GetOneByOpenid ¶
type CodeRepository ¶
type CodeRepository struct { }
func (*CodeRepository) GetByTelAndCode ¶
type GithubAccessTokenReq ¶
type GithubErrResp ¶
type GithubOption ¶
type GithubOption func(repo *GithubRepository)
func WithClientId ¶
func WithClientId(clientId string) GithubOption
func WithClientSecret ¶
func WithClientSecret(clientSecret string) GithubOption
type GithubRepository ¶
type GithubRepository struct {
// contains filtered or unexported fields
}
func (*GithubRepository) GetAccessToken ¶
func (r *GithubRepository) GetAccessToken(code string) (*domain.GithubAccessTokenResp, error)
func (*GithubRepository) UserInfo ¶
func (r *GithubRepository) UserInfo(accessToken, openid string) (*domain.GithubUserInfoResp, error)
type GithubUserErrResp ¶
type GithubUserResp ¶
type GithubUserResp struct { Login string `json:"login"` ID int64 `json:"id"` NodeID string `json:"node_id"` AvatarURL string `json:"avatar_url"` GravatarID string `json:"gravatar_id"` URL string `json:"url"` HTMLURL string `json:"html_url"` FollowersURL string `json:"followers_url"` FollowingURL string `json:"following_url"` GistsURL string `json:"gists_url"` StarredURL string `json:"starred_url"` SubscriptionsURL string `json:"subscriptions_url"` OrganizationsURL string `json:"organizations_url"` ReposURL string `json:"repos_url"` EventsURL string `json:"events_url"` ReceivedEventsURL string `json:"received_events_url"` Type string `json:"type"` SiteAdmin bool `json:"site_admin"` Name string `json:"name"` Company string `json:"company"` Blog string `json:"blog"` Location string `json:"location"` Email string `json:"email"` Hireable string `json:"hireable"` Bio string `json:"bio"` TwitterUsername string `json:"twitter_username"` PublicRepos int64 `json:"public_repos"` PublicGists int64 `json:"public_gists"` Followers int64 `json:"followers"` Following int64 `json:"following"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` PrivateGists int64 `json:"private_gists"` TotalPrivateRepos int64 `json:"total_private_repos"` OwnedPrivateRepos int64 `json:"owned_private_repos"` DiskUsage int64 `json:"disk_usage"` Collaborators int64 `json:"collaborators"` TwoFactorAuthentication bool `json:"two_factor_authentication"` Plan Plan `json:"plan"` }
type PrivateTelInfoRepository ¶
type PrivateTelInfoRepository struct { }
func (*PrivateTelInfoRepository) DelByHashFromCache ¶
func (pTr *PrivateTelInfoRepository) DelByHashFromCache(ctx context.Context, hash string) error
func (*PrivateTelInfoRepository) GetOneByHash ¶
func (pTr *PrivateTelInfoRepository) GetOneByHash(ctx context.Context, hash string) (*domain.PrivateTelInfo, error)
Click to show internal directories.
Click to hide internal directories.