model

package
v0.0.0-...-9dc60f2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUser

func CreateUser(ctx context.Context, client *dgraph.Client, user *User) error

CreateUser will persist the user in the Dgraph database

func LoginUser

func LoginUser(ctx context.Context, client *dgraph.Client, email string, password string) (*string, error)

LoginUser verifies that the email and password are valid and returns the UID of the user.

Types

type FindUserOptions

type FindUserOptions struct {
	Fields string
}

FindUserOptions Options for FindUser()

type LikedResponse

type LikedResponse struct {
	Success bool `json:"success"`
	Matched bool `json:"matched"`
}

func LikeUser

func LikeUser(ctx context.Context, client *dgraph.Client, currentUser *User, targetUserID string) (*LikedResponse, error)

LikeUser Like a user

type NewUser

type NewUser struct {
	Name     string `json:"name"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

type User

type User struct {
	ID       string   `json:"id"`
	UID      string   `json:"uid,omitempty"`
	Name     string   `json:"name,omitempty"`
	Email    string   `json:"email"`
	Password string   `json:"password"`
	DType    []string `json:"dgraph.type,omitempty"`
}

User model

func FindMatches

func FindMatches(ctx context.Context, client *dgraph.Client, currentUser *User, options *FindUserOptions) ([]*User, error)

FindMatches Find the matches for the given user

func FindUser

func FindUser(ctx context.Context, client *dgraph.Client, id string, options *FindUserOptions) (*User, error)

FindUser find the user based on their ID.

Jump to

Keyboard shortcuts

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