usecase

package
v0.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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) Get

func (u *Usecase) Get(ctx context.Context, id uint64) (*model.AccountSocial, error)

Get social account by id

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

func (*Usecase) Token

func (u *Usecase) Token(ctx context.Context, name string, accountSocialID uint64) (*elogin.Token, error)

Token returns social account token by id

func (*Usecase) Update

func (u *Usecase) Update(ctx context.Context, id uint64, account *model.AccountSocial) error

Update social account by id

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL