Documentation
¶
Index ¶
- Constants
- func GenerateToken() (fullToken string, tokenPrefix string, err error)
- func HashToken(token string) string
- func RegisterRoutes(protected *gin.RouterGroup, writeProtected *gin.RouterGroup, ...)
- type ErrorResponse
- type ServerDependencies
- type TokenService
- func (s *TokenService) Create(name string) (*models.ApiToken, string, error)
- func (s *TokenService) List() ([]models.ApiToken, error)
- func (s *TokenService) Regenerate(id string) (*models.ApiToken, string, error)
- func (s *TokenService) Revoke(id string) error
- func (s *TokenService) Validate(rawToken string) (*models.ApiToken, error)
Constants ¶
View Source
const TokenPrefix = "jv_"
Variables ¶
This section is empty.
Functions ¶
func GenerateToken ¶
func RegisterRoutes ¶
func RegisterRoutes(protected *gin.RouterGroup, writeProtected *gin.RouterGroup, deps *core.ServerDependencies)
Types ¶
type ErrorResponse ¶
type ErrorResponse = contracts.ErrorResponse
type ServerDependencies ¶
type ServerDependencies = core.ServerDependencies
type TokenService ¶
type TokenService struct {
// contains filtered or unexported fields
}
func NewTokenService ¶
func NewTokenService(repo database.ApiTokenRepositoryInterface) *TokenService
func (*TokenService) Regenerate ¶
func (*TokenService) Revoke ¶
func (s *TokenService) Revoke(id string) error
Click to show internal directories.
Click to hide internal directories.