users

package
v0.0.0-...-cacc30e Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(username string) (string, error)

Types

type CustomClaims

type CustomClaims struct {
	Username string `json:"username"`
	jwt.StandardClaims
}

type LoggedInUser

type LoggedInUser struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	Token    string `json:"token"`
}

type User

type User struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	Password string `json:"password,omitempty"`
}

type UserLogin

type UserLogin struct {
	User User `json:"user"`
}

type UserLoginHandler

type UserLoginHandler struct {
	Path           string
	UserRepository UserRepository
}

func (*UserLoginHandler) Login

type UserNeo4jRepository

type UserNeo4jRepository struct {
	Driver neo4j.Driver
}

func (*UserNeo4jRepository) AddPost

func (u *UserNeo4jRepository) AddPost(post *post.Post) (err error)

func (*UserNeo4jRepository) FindByUserAndPassword

func (u *UserNeo4jRepository) FindByUserAndPassword(username string, password string) (bool, error)

func (*UserNeo4jRepository) FollowUser

func (u *UserNeo4jRepository) FollowUser(username, follow string) error

func (*UserNeo4jRepository) GetFollowedPosts

func (u *UserNeo4jRepository) GetFollowedPosts(username string) []post.Post

func (*UserNeo4jRepository) GetLikes

func (u *UserNeo4jRepository) GetLikes(id int64) int

func (*UserNeo4jRepository) GetUserPosts

func (u *UserNeo4jRepository) GetUserPosts(username string) []post.Post

func (*UserNeo4jRepository) GetUsers

func (u *UserNeo4jRepository) GetUsers(me string) []string

func (*UserNeo4jRepository) LikePost

func (u *UserNeo4jRepository) LikePost(username string, id int64) (err error)

func (*UserNeo4jRepository) RegisterUser

func (u *UserNeo4jRepository) RegisterUser(user *User) (err error)

type UserRegistration

type UserRegistration struct {
	User User `json:"user"`
}

type UserRegistrationHandler

type UserRegistrationHandler struct {
	Path           string
	UserRepository UserRepository
}

func (*UserRegistrationHandler) Register

type UserRepository

type UserRepository interface {
	RegisterUser(*User) error
	FindByUserAndPassword(string, string) (bool, error)
}

Jump to

Keyboard shortcuts

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