Documentation
¶
Index ¶
- type Service
- func (s *Service) Create(ctx context.Context, newUser *usersmodels.NewUser) (*usersmodels.User, error)
- func (s *Service) Exists(ctx context.Context, userID string) (bool, error)
- func (s *Service) GetBalance(ctx context.Context, userID string) (bsv.Satoshis, error)
- func (s *Service) GetByID(ctx context.Context, userID string) (*usersmodels.User, error)
- func (s *Service) GetIDByPubKey(ctx context.Context, pubKey string) (string, error)
- func (s *Service) GetPubKey(ctx context.Context, userID string) (*primitives.PublicKey, error)
- func (s *Service) Remove(ctx context.Context, userID string) error
- type UserRepo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a user domain service
func NewService ¶
NewService creates a new user service
func (*Service) Create ¶
func (s *Service) Create(ctx context.Context, newUser *usersmodels.NewUser) (*usersmodels.User, error)
Create creates a new user
func (*Service) GetBalance ¶
GetBalance returns current balance for the user
func (*Service) GetIDByPubKey ¶
GetIDByPubKey returns the user ID selected by pubKey
type UserRepo ¶
type UserRepo interface {
Exists(ctx context.Context, userID string) (bool, error)
GetIDByPubKey(ctx context.Context, pubKey string) (string, error)
Get(ctx context.Context, userID string) (*usersmodels.User, error)
Create(ctx context.Context, newUser *usersmodels.NewUser) (*usersmodels.User, error)
GetBalance(ctx context.Context, userID string, name bucket.Name) (bsv.Satoshis, error)
Delete(ctx context.Context, userID string) error
}
UserRepo is an interface for users repository.
Click to show internal directories.
Click to hide internal directories.