Documentation ¶
Index ¶
- func Confirm(hash, password string) *sample_error.SampleError
- func Generate(password string) (string, *sample_error.SampleError)
- type AuthSharedService
- type RefreshTokenService
- type SampleService
- func (s *SampleService) Add(token *jwt.Token, name string, detail string) (*app.Sample, *sample_error.SampleError)
- func (s *SampleService) Delete(token *jwt.Token, id int) *sample_error.SampleError
- func (s *SampleService) GetSamples(token *jwt.Token) (app.SamplesCollection, *sample_error.SampleError)
- func (s *SampleService) Show(token *jwt.Token, id int) (*app.Sample, *sample_error.SampleError)
- func (s *SampleService) Update(token *jwt.Token, id int, name string, detail string) *sample_error.SampleError
- type UserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Confirm ¶
func Confirm(hash, password string) *sample_error.SampleError
func Generate ¶
func Generate(password string) (string, *sample_error.SampleError)
Types ¶
type AuthSharedService ¶
type AuthSharedService struct {
// contains filtered or unexported fields
}
JWTController implements the JWT resource.
func NewAuthSharedService ¶
func NewAuthSharedService() (*AuthSharedService, *sample_error.SampleError)
func (*AuthSharedService) GetId ¶
func (c *AuthSharedService) GetId(token *jwt.Token) (int, *sample_error.SampleError)
Secure runs the secure action.
func (*AuthSharedService) IssueTokens ¶
func (s *AuthSharedService) IssueTokens(id int) (*app.Auth, string, *sample_error.SampleError)
func (*AuthSharedService) VerifyToken ¶
func (c *AuthSharedService) VerifyToken(tokenString string) (string, *sample_error.SampleError)
type RefreshTokenService ¶
type RefreshTokenService struct {
// contains filtered or unexported fields
}
func NewHashedRefreshTokenService ¶
func NewHashedRefreshTokenService(db *gorm.DB) (*RefreshTokenService, *sample_error.SampleError)
func (*RefreshTokenService) AddOrUpdate ¶
func (s *RefreshTokenService) AddOrUpdate(userId int, jti string) *sample_error.SampleError
func (*RefreshTokenService) Update ¶
func (s *RefreshTokenService) Update(refreshToken string) (*app.Auth, *sample_error.SampleError)
type SampleService ¶
type SampleService struct { User *UserService // contains filtered or unexported fields }
func NewSampleService ¶
func NewSampleService(db *gorm.DB) (*SampleService, *sample_error.SampleError)
func (*SampleService) Add ¶
func (s *SampleService) Add(token *jwt.Token, name string, detail string) (*app.Sample, *sample_error.SampleError)
func (*SampleService) Delete ¶
func (s *SampleService) Delete(token *jwt.Token, id int) *sample_error.SampleError
func (*SampleService) GetSamples ¶
func (s *SampleService) GetSamples(token *jwt.Token) (app.SamplesCollection, *sample_error.SampleError)
func (*SampleService) Show ¶
func (s *SampleService) Show(token *jwt.Token, id int) (*app.Sample, *sample_error.SampleError)
func (*SampleService) Update ¶
func (s *SampleService) Update(token *jwt.Token, id int, name string, detail string) *sample_error.SampleError
type UserService ¶
type UserService struct { Auth *AuthSharedService // contains filtered or unexported fields }
func NewUserService ¶
func NewUserService(db *gorm.DB) (*UserService, *sample_error.SampleError)
func (*UserService) AuthWithEmailAndPassword ¶
func (s *UserService) AuthWithEmailAndPassword(email, password string) (*app.Auth, *sample_error.SampleError)
func (*UserService) AuthWithToken ¶
func (s *UserService) AuthWithToken(token *jwt.Token) (*int, *sample_error.SampleError)
Click to show internal directories.
Click to hide internal directories.