Documentation ¶
Index ¶
- Constants
- Variables
- type Service
- func (svc *Service) CheckUserPassword(usr *ent.User, password string) bool
- func (svc *Service) CreateContact(ctx context.Context, data *models.ContactPayload, userID int) (*ent.Contact, error)
- func (svc *Service) CreateToken(ctx context.Context, user *ent.User) (*ent.Token, error)
- func (svc *Service) CreateUser(ctx context.Context, user models.User) (*ent.User, error)
- func (svc *Service) CurrentUser(ctx context.Context, r *http.Request) (int, error)
- func (svc *Service) DeleteContact(ctx context.Context, cnc *ent.Contact) error
- func (svc *Service) GetContact(ctx context.Context, contactID int) (*ent.Contact, error)
- func (svc *Service) GetUserByUsername(ctx context.Context, username string) (*ent.User, error)
- func (svc *Service) GetUserContacts(ctx context.Context, userId int) ([]*ent.Contact, error)
- func (svc *Service) GetUserIDByToken(ctx context.Context, tokenValue string) (int, error)
- func (svc *Service) UpdateContact(ctx context.Context, contct *ent.Contact, data models.ContactPayload) (*ent.Contact, error)
Constants ¶
View Source
const (
TokenLength = 16
)
Variables ¶
View Source
var UnAuthorizedErr = errors.New("Unauthorized")
Functions ¶
This section is empty.
Types ¶
type Service ¶
func (*Service) CheckUserPassword ¶
func (*Service) CreateContact ¶
func (*Service) CreateToken ¶
func (*Service) CreateUser ¶
CreateUser bcyrpt password and save it in databas
func (*Service) CurrentUser ¶
func (*Service) DeleteContact ¶
func (*Service) GetContact ¶
func (*Service) GetUserByUsername ¶
func (*Service) GetUserContacts ¶
func (*Service) GetUserIDByToken ¶
Click to show internal directories.
Click to hide internal directories.