invite

package
v0.0.0-...-1f0a743 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2020 License: MIT Imports: 5 Imported by: 0

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

func (s *Service) CreateInvite(addr address.HashAddress, expiry time.Duration) (string, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL