org

package
v0.0.0-...-94fc6d2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUserToken

func CreateUserToken(userID uint64, ttl time.Duration) (string, error)

func MustUserMiddleware

func MustUserMiddleware(c *gin.Context)

func UserMiddleware

func UserMiddleware(c *gin.Context)

Types

type FollowUser

type FollowUser struct {
	UserID         uint64
	FollowedUserID uint64
	// contains filtered or unexported fields
}

type Profile

type Profile struct {
	ID        uint64 `json:"-"`
	Username  string `json:"username"`
	Bio       string `json:"bio"`
	Image     string `json:"image"`
	Following bool   `pg:"-" json:"following"`
	// contains filtered or unexported fields
}

func NewProfile

func NewProfile(user *User) *Profile

type User

type User struct {
	ID           uint64 `json:"-"`
	Username     string `json:"username"`
	Email        string `json:"email"`
	Bio          string `json:"bio"`
	Image        string `json:"image"`
	Password     string `pg:"-" json:"password,omitempty"`
	PasswordHash string `json:"-"`
	Following    bool   `pg:"-" json:"following"`

	Token string `pg:"-" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func SelectUser

func SelectUser(ctx context.Context, userID uint64) (*User, error)

func SelectUserByUsername

func SelectUserByUsername(ctx context.Context, username string) (*User, error)

Jump to

Keyboard shortcuts

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