domain

package
v0.0.0-...-c256c1c Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadCredentials  = errors.New("email and password don't match")
	ErrUnauthenticated = errors.New("unauthenticated")
	ErrForbidden       = errors.New("unauthorized")
)

Functions

This section is empty.

Types

type Domain

type Domain struct {
	UserStore   *db.UserRepo
	MeetupStore *db.MeetupRepo
}

func NewDomain

func NewDomain(userStore *db.UserRepo, meetupStore *db.MeetupRepo) *Domain

func (*Domain) CreateMeetup

func (d *Domain) CreateMeetup(ctx context.Context, input model.NewMeetup) (*model.Meetup, error)

func (*Domain) DeleteMeetup

func (d *Domain) DeleteMeetup(ctx context.Context, id string) (bool, error)

func (*Domain) Login

func (d *Domain) Login(ctx context.Context, input model.LoginInput) (*model.AuthResponse, error)

Login login an existing user

func (*Domain) Register

func (d *Domain) Register(ctx context.Context, input model.RegisterInput) (*model.AuthResponse, error)

Register registers a new user

func (*Domain) UpdateMeetup

func (d *Domain) UpdateMeetup(ctx context.Context, id string, input model.UpdateMeetup) (*model.Meetup, error)

type Owner

type Owner interface {
	IsOwner(user *model.User) bool
}

Jump to

Keyboard shortcuts

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