Documentation ¶
Index ¶
- type CreateEntryRequest
- type CreateEntryResponse
- type CreateUserRequest
- type CreateUserResponse
- type DecryptEntryRequest
- type DecryptEntryResponse
- type EntryRepository
- type EntryService
- func (s *EntryService) CreateEntry(req CreateEntryRequest) (*CreateEntryResponse, error)
- func (s *EntryService) DecryptEntry(req DecryptEntryRequest) (*DecryptEntryResponse, error)
- func (s *EntryService) FindByUserID(userID uuid.UUID) ([]sendkey.Entry, error)
- func (s *EntryService) FindEntry(id uuid.UUID, nonce string) (*sendkey.Entry, error)
- func (s *EntryService) SendEntry(entry sendkey.Entry) error
- type UserLoginRequest
- type UserLoginResponse
- type UserRepository
- type UserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateEntryRequest ¶
type CreateEntryResponse ¶
type CreateUserRequest ¶
type CreateUserResponse ¶
type DecryptEntryRequest ¶
type DecryptEntryResponse ¶
type EntryRepository ¶
type EntryRepository interface { Find(uuid.UUID) (*sendkey.Entry, error) FindByUserID(uuid.UUID) ([]sendkey.Entry, error) Create(sendkey.Entry) error Delete(uuid.UUID) error IncrementInvalidAttempts(uuid.UUID) (int, error) CreateClaimedEntry(sendkey.ClaimedEntry) error CreateExpiredEntry(sendkey.ExpiredEntry) error }
type EntryService ¶
type EntryService struct {
// contains filtered or unexported fields
}
func NewEntryService ¶
func NewEntryService(er EntryRepository, key []byte, maxAttempts int) *EntryService
The key argument should be the AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256. The maxAttempts argument is the number of invalid attempts allowed before an entry is forcefully expired.
func (*EntryService) CreateEntry ¶
func (s *EntryService) CreateEntry(req CreateEntryRequest) (*CreateEntryResponse, error)
func (*EntryService) DecryptEntry ¶
func (s *EntryService) DecryptEntry(req DecryptEntryRequest) (*DecryptEntryResponse, error)
func (*EntryService) FindByUserID ¶
type UserLoginRequest ¶
type UserLoginResponse ¶
type UserRepository ¶
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService(users UserRepository) *UserService
func (*UserService) CreateUser ¶
func (s *UserService) CreateUser(req CreateUserRequest) (*CreateUserResponse, error)
func (*UserService) Login ¶
func (s *UserService) Login(req UserLoginRequest) (*UserLoginResponse, error)
Click to show internal directories.
Click to hide internal directories.