Documentation
¶
Index ¶
- type Auth
- type AuthService
- func (s *AuthService) RefreshToken(ctx context.Context, input domain.RefreshTokenInput) (string, error)
- func (s *AuthService) SignIn(ctx context.Context, input domain.SignInInput) (*domain.Tokens, error)
- func (s *AuthService) SignOut(ctx context.Context, input domain.RefreshTokenInput) error
- func (s *AuthService) SignUp(ctx context.Context, input domain.SignUpInput) (*domain.Tokens, error)
- type Post
- type PostService
- func (s *PostService) Create(ctx context.Context, input domain.CreatePostInput) (ksuid.KSUID, error)
- func (s *PostService) Delete(ctx context.Context, id, authorId ksuid.KSUID) error
- func (s *PostService) Get(ctx context.Context, id ksuid.KSUID) (*domain.Post, error)
- func (s *PostService) GetPosts(ctx context.Context, authorId ksuid.KSUID, sort domain.SortOptions) ([]*domain.Post, error)
- func (s *PostService) Update(ctx context.Context, input domain.UpdatePostInput) error
- type Service
- type User
- type UserService
- func (s *UserService) CreateVerifyEmailCode(ctx context.Context, email string) error
- func (s *UserService) ForgotPassword(ctx context.Context, input domain.ForgotPasswordInput) error
- func (s *UserService) GetById(ctx context.Context, id ksuid.KSUID) (*domain.User, error)
- func (s *UserService) VerifyEmailCode(ctx context.Context, email string, code uint64) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth interface { SignUp(ctx context.Context, input domain.SignUpInput) (*domain.Tokens, error) SignIn(ctx context.Context, input domain.SignInInput) (*domain.Tokens, error) SignOut(ctx context.Context, input domain.RefreshTokenInput) error RefreshToken(ctx context.Context, input domain.RefreshTokenInput) (string, error) }
User auth interface.
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
User auth service structure.
func NewAuthService ¶
func NewAuthService(client v1.UserAuthServiceClient) *AuthService
Creating a new auth service.
func (*AuthService) RefreshToken ¶
func (s *AuthService) RefreshToken(ctx context.Context, input domain.RefreshTokenInput) (string, error)
Refresh user auth tokens by refresh token.
func (*AuthService) SignIn ¶
func (s *AuthService) SignIn(ctx context.Context, input domain.SignInInput) (*domain.Tokens, error)
User Sign In.
func (*AuthService) SignOut ¶
func (s *AuthService) SignOut(ctx context.Context, input domain.RefreshTokenInput) error
User Sign Out.
func (*AuthService) SignUp ¶
func (s *AuthService) SignUp(ctx context.Context, input domain.SignUpInput) (*domain.Tokens, error)
User Sign Up.
type Post ¶
type Post interface { // Creating a new post. Create(ctx context.Context, input domain.CreatePostInput) (ksuid.KSUID, error) // Deleting a post. Delete(ctx context.Context, id, authorId ksuid.KSUID) error // Updating a post. Update(ctx context.Context, input domain.UpdatePostInput) error // Getting a post. Get(ctx context.Context, id ksuid.KSUID) (*domain.Post, error) // Getting author posts. GetPosts(ctx context.Context, authorId ksuid.KSUID, sort domain.SortOptions) ([]*domain.Post, error) }
Post service interface.
type PostService ¶
type PostService struct {
// contains filtered or unexported fields
}
Post service structure.
func NewPostService ¶
func NewPostService(client v1.PostServiceClient) *PostService
Creating a new post service.
func (*PostService) Create ¶
func (s *PostService) Create(ctx context.Context, input domain.CreatePostInput) (ksuid.KSUID, error)
Creating a new post.
func (*PostService) GetPosts ¶
func (s *PostService) GetPosts(ctx context.Context, authorId ksuid.KSUID, sort domain.SortOptions) ([]*domain.Post, error)
Getting author posts.
func (*PostService) Update ¶
func (s *PostService) Update(ctx context.Context, input domain.UpdatePostInput) error
Updating a post.
type User ¶
type User interface { GetById(ctx context.Context, id ksuid.KSUID) (*domain.User, error) ForgotPassword(ctx context.Context, input domain.ForgotPasswordInput) error CreateVerifyEmailCode(ctx context.Context, email string) error VerifyEmailCode(ctx context.Context, email string, code uint64) (bool, error) }
User interface.
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
User service structure.
func NewUserService ¶
func NewUserService(user v1.UserServiceClient, code v1.UserCodeServiceClient) *UserService
Creating a new user service.
func (*UserService) CreateVerifyEmailCode ¶
func (s *UserService) CreateVerifyEmailCode(ctx context.Context, email string) error
Creating a new verify user email code.
func (*UserService) ForgotPassword ¶
func (s *UserService) ForgotPassword(ctx context.Context, input domain.ForgotPasswordInput) error
Forgot user password.
func (*UserService) VerifyEmailCode ¶
Verifying user email code.
Click to show internal directories.
Click to hide internal directories.