Documentation
¶
Index ¶
- type Auth
- type AuthService
- func (s *AuthService) RefreshToken(ctx context.Context, input domain.SessionCredInput) (string, error)
- func (s *AuthService) SignIn(ctx context.Context, input domain.SignInInput) (*domain.Tokens, 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 ksuid.KSUID) (bool, error)
- func (s *PostService) Get(ctx context.Context, id ksuid.KSUID) (*domain.Post, error)
- func (s *PostService) GetList(ctx context.Context, sort domain.SortOptions) (*domain.PostConnection, error)
- func (s *PostService) Update(ctx context.Context, input domain.UpdatePostInput) (bool, error)
- type Service
- type Session
- type SessionService
- func (s *SessionService) Create(userId ksuid.KSUID) (*domain.Tokens, error)
- func (s *SessionService) Delete(ctx context.Context, id ksuid.KSUID) (bool, error)
- func (s *SessionService) Get(ctx context.Context, id ksuid.KSUID) (*domain.Session, error)
- func (s *SessionService) GetList(ctx context.Context, sort domain.SortOptions) (*domain.SessionConnection, error)
- type User
- type UserService
- func (s *UserService) CreateVerifyEmailCode(ctx context.Context, email string) (bool, error)
- func (s *UserService) ForgotPassword(ctx context.Context, input domain.ForgotPasswordInput) (bool, error)
- func (s *UserService) Get(ctx context.Context, id ksuid.KSUID) (*domain.User, error)
- func (s *UserService) UpdateAvatar(ctx context.Context, file graphql.Upload) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth interface { // User Sign Up. SignUp(ctx context.Context, input domain.SignUpInput) (*domain.Tokens, error) // User Sign In. SignIn(ctx context.Context, input domain.SignInInput) (*domain.Tokens, error) // Refresh user access token token. RefreshToken(ctx context.Context, input domain.SessionCredInput) (string, error) }
Auth service interface.
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
Auth service structure.
func NewAuthService ¶
func NewAuthService(session Session, cfg *config.AuthConfig) *AuthService
Creating a new auth service.
func (*AuthService) RefreshToken ¶
func (s *AuthService) RefreshToken(ctx context.Context, input domain.SessionCredInput) (string, error)
Refresh user access token token.
func (*AuthService) SignIn ¶
func (s *AuthService) SignIn(ctx context.Context, input domain.SignInInput) (*domain.Tokens, error)
User Sign In.
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 ksuid.KSUID) (bool, error) // Updating a post. Update(ctx context.Context, input domain.UpdatePostInput) (bool, error) // Getting a post. Get(ctx context.Context, id ksuid.KSUID) (*domain.Post, error) // Getting a posts. GetList(ctx context.Context, sort domain.SortOptions) (*domain.PostConnection, error) }
Post service interface.
type PostService ¶
type PostService struct{}
Post service structure.
func (*PostService) Create ¶
func (s *PostService) Create(ctx context.Context, input domain.CreatePostInput) (ksuid.KSUID, error)
Creating a new post.
func (*PostService) GetList ¶
func (s *PostService) GetList(ctx context.Context, sort domain.SortOptions) (*domain.PostConnection, error)
Getting a posts.
func (*PostService) Update ¶
func (s *PostService) Update(ctx context.Context, input domain.UpdatePostInput) (bool, error)
Updating a post.
type Session ¶
type Session interface { // Creating a new fake user session. Create(userId ksuid.KSUID) (*domain.Tokens, error) // Deleting a fake user session. Delete(ctx context.Context, id ksuid.KSUID) (bool, error) // Getting a fake user session. Get(ctx context.Context, id ksuid.KSUID) (*domain.Session, error) // Getting a fake user sessions. GetList(ctx context.Context, sort domain.SortOptions) (*domain.SessionConnection, error) }
User session service interface.
type SessionService ¶
type SessionService struct {
// contains filtered or unexported fields
}
User session service structure.
func NewSessionService ¶
func NewSessionService(cfg *config.AuthConfig) *SessionService
Creating a new user session service.
func (*SessionService) GetList ¶
func (s *SessionService) GetList(ctx context.Context, sort domain.SortOptions) (*domain.SessionConnection, error)
Getting a user sessions.
type User ¶
type User interface { // Creating a new user verification email code. CreateVerifyEmailCode(ctx context.Context, email string) (bool, error) // Forgot user password. ForgotPassword(ctx context.Context, input domain.ForgotPasswordInput) (bool, error) // Update user avatar. UpdateAvatar(ctx context.Context, file graphql.Upload) (string, error) // Getting a user. Get(ctx context.Context, id ksuid.KSUID) (*domain.User, error) }
User service interface.
type UserService ¶
type UserService struct{}
User service structure.
func (*UserService) CreateVerifyEmailCode ¶
Creating a new user verification email code.
func (*UserService) ForgotPassword ¶
func (s *UserService) ForgotPassword(ctx context.Context, input domain.ForgotPasswordInput) (bool, error)
Forgot user password.
func (*UserService) UpdateAvatar ¶
Update user avatar.
Click to show internal directories.
Click to hide internal directories.