Documentation ¶
Index ¶
- func FindGrantByGrantID(grantID uuid.UUID) (*grant, error)
- func FindGrantByToken(ctx context.Context, accessToken Token) (*grant, error)
- func NewGrant(subjectID uuid.UUID) *grant
- func RegisterGrant(ctx context.Context, g *grant) (*AccessToken, *RefreshToken, error)
- type AccessToken
- type Credential
- type CredentialRepository
- type CredentialService
- func (s *CredentialService) CreateCredential(ctx context.Context, credential *Credential) error
- func (s *CredentialService) DeleteById(ctx context.Context, credentialId string) error
- func (s *CredentialService) GetCredentialByCredentialID(ctx context.Context, id []byte) (*Credential, error)
- func (s *CredentialService) GetCredentialByID(ctx context.Context, id string) (*Credential, error)
- func (s *CredentialService) GetCredentialsByUserID(ctx context.Context, userId uuid.UUID) ([]*Credential, error)
- type GrantRepo
- type GrantStore
- type RefreshToken
- type Token
- type User
- type UserRepository
- type UserService
- func (s *UserService) CreateUser(ctx context.Context, user *User) error
- func (s *UserService) DeleteById(ctx context.Context, id string) error
- func (s *UserService) GetUserById(ctx context.Context, id string) (*User, error)
- func (s *UserService) GetUserByUserID(ctx context.Context, userId []byte) (*User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindGrantByGrantID ¶
func FindGrantByToken ¶
func RegisterGrant ¶
func RegisterGrant(ctx context.Context, g *grant) (*AccessToken, *RefreshToken, error)
Types ¶
type AccessToken ¶
type AccessToken [32]byte
func LeaseGrant ¶
func LeaseGrant(ctx context.Context, refreshToken *RefreshToken) (*AccessToken, *grant, error)
func (*AccessToken) Key ¶
func (token *AccessToken) Key() string
func (*AccessToken) MarshalJSON ¶
func (token *AccessToken) MarshalJSON() ([]byte, error)
type Credential ¶
type CredentialRepository ¶
type CredentialRepository interface { core.Repository[string, *Credential] FindByCredentialId(ctx context.Context, credentialId []byte) (*Credential, error) FindByUserID(ctx context.Context, userID uuid.UUID) ([]*Credential, error) }
type CredentialService ¶
type CredentialService struct {
// contains filtered or unexported fields
}
func NewCredentialService ¶
func NewCredentialService(credentialRepo CredentialRepository) *CredentialService
func (*CredentialService) CreateCredential ¶
func (s *CredentialService) CreateCredential(ctx context.Context, credential *Credential) error
func (*CredentialService) DeleteById ¶
func (s *CredentialService) DeleteById(ctx context.Context, credentialId string) error
func (*CredentialService) GetCredentialByCredentialID ¶
func (s *CredentialService) GetCredentialByCredentialID(ctx context.Context, id []byte) (*Credential, error)
func (*CredentialService) GetCredentialByID ¶
func (s *CredentialService) GetCredentialByID(ctx context.Context, id string) (*Credential, error)
func (*CredentialService) GetCredentialsByUserID ¶
func (s *CredentialService) GetCredentialsByUserID(ctx context.Context, userId uuid.UUID) ([]*Credential, error)
type GrantStore ¶
type GrantStore = core.KeyValueStore[string, *grant]
type RefreshToken ¶
type RefreshToken [48]byte
func (RefreshToken) Key ¶
func (token RefreshToken) Key() string
func (*RefreshToken) MarshalJSON ¶
func (token *RefreshToken) MarshalJSON() ([]byte, error)
type UserRepository ¶
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService(userRepo UserRepository) *UserService
func (*UserService) CreateUser ¶
func (s *UserService) CreateUser(ctx context.Context, user *User) error
func (*UserService) DeleteById ¶
func (s *UserService) DeleteById(ctx context.Context, id string) error
func (*UserService) GetUserById ¶
func (*UserService) GetUserByUserID ¶
Click to show internal directories.
Click to hide internal directories.