Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { CreateInvite(addr address.HashAddress, expiry time.Duration) (string, error) GetInvite(addr address.HashAddress) (string, error) RemoveInvite(addr address.HashAddress) error }
Repository is the generic repository for dealing with invitations
func NewRedisRepository ¶
func NewRedisRepository(opts *redis.Options) Repository
NewRedisRepository initializes a new repository
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the invitation service
func NewInviteService ¶
func NewInviteService(repo Repository) *Service
NewInviteService create new invitation service based on the given repository
func (*Service) CreateInvite ¶
CreateInvite creates a new invitation in the repository
func (*Service) GetInvite ¶
func (s *Service) GetInvite(addr address.HashAddress) (string, error)
GetInvite retrieves an invitation from the repository
func (*Service) RemoveInvite ¶
func (s *Service) RemoveInvite(addr address.HashAddress) error
RemoveInvite deletes an invitation from the repository
Click to show internal directories.
Click to hide internal directories.