Documentation ¶
Index ¶
- Variables
- type Usecase
- func (u *Usecase) Get(ctx context.Context, id uint64) (*model.AccountSocial, error)
- func (u *Usecase) List(ctx context.Context, filter *socialauth.Filter) ([]*model.AccountSocial, error)
- func (u *Usecase) Register(ctx context.Context, ownerObj *model.User, accountObj *model.AccountSocial) (uint64, error)
- func (u *Usecase) SetToken(ctx context.Context, name string, accountSocialID uint64, token *elogin.Token) error
- func (u *Usecase) Token(ctx context.Context, name string, accountSocialID uint64) (*elogin.Token, error)
- func (u *Usecase) Update(ctx context.Context, id uint64, account *model.AccountSocial) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLinkToExistsUser = errors.New("to connect social account to exists user, need to be authorized")
Functions ¶
This section is empty.
Types ¶
type Usecase ¶
type Usecase struct {
// contains filtered or unexported fields
}
func New ¶
func New(userRepo user.Repository, socAccountRepo socialauth.Repository) *Usecase
func (*Usecase) List ¶
func (u *Usecase) List(ctx context.Context, filter *socialauth.Filter) ([]*model.AccountSocial, error)
List social accounts by filter
func (*Usecase) Register ¶
func (u *Usecase) Register(ctx context.Context, ownerObj *model.User, accountObj *model.AccountSocial) (uint64, error)
Register new social account and link it to the user
func (*Usecase) SetToken ¶
func (u *Usecase) SetToken(ctx context.Context, name string, accountSocialID uint64, token *elogin.Token) error
SetToken sets social account token by id
Click to show internal directories.
Click to hide internal directories.