services

package
v0.0.0-...-8a4eff6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder interface {
	Encode(userID int, isAdmin bool) (string, error)
}

type TeamService

type TeamService struct {
	// contains filtered or unexported fields
}

func NewTeamService

func NewTeamService(repo auth.TeamRepository, userRepo auth.UserRepository) *TeamService

func (*TeamService) Create

func (s *TeamService) Create(callerID int, team auth.Team) (auth.Team, error)

func (*TeamService) Delete

func (s *TeamService) Delete(callerID, teamID int) error

func (*TeamService) Get

func (s *TeamService) Get(callerID int, teamID int) (auth.Team, error)

func (*TeamService) GetForUser

func (s *TeamService) GetForUser(callerID int) ([]auth.Team, error)

func (*TeamService) Invite

func (s *TeamService) Invite(callerID, teamID int, memberEmail string) (auth.Team, error)

func (*TeamService) Kick

func (s *TeamService) Kick(callerID, teamID, memberID int) (auth.Team, error)

func (*TeamService) Share

func (s *TeamService) Share(callerID, teamID, paperID int, canEdit bool) (auth.Team, error)

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

func NewUserService

func NewUserService(repo auth.UserRepository, encoder Encoder) *UserService

func (*UserService) All

func (s *UserService) All() ([]auth.User, error)

func (*UserService) Bookmark

func (s *UserService) Bookmark(callerID, paperID int, bookmark bool) (auth.User, error)

func (*UserService) CreatePaper

func (s *UserService) CreatePaper(userID, paperID int) (auth.User, error)

func (*UserService) Delete

func (s *UserService) Delete(userID int) error

func (*UserService) Get

func (s *UserService) Get(id int) (auth.User, error)

func (*UserService) Login

func (s *UserService) Login(email, password string) (string, error)

func (*UserService) SignUp

func (s *UserService) SignUp(email, password string) (string, error)

func (*UserService) Token

func (s *UserService) Token(userID int) (string, error)

func (*UserService) Upsert

func (s *UserService) Upsert(u auth.User) (auth.User, error)

Jump to

Keyboard shortcuts

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