user

package
v0.0.0-...-43a8b31 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareUserBasic

func CompareUserBasic(u1 wings.UserBasic, u2 wings.UserBasic) (bool, []string)

func CompareUserObj

func CompareUserObj(u1 UserObj, u2 UserObj) (bool, []string)

func DeleteUserObj

func DeleteUserObj(toDelete wings.UserBasic, self int) bool

func GetUsernameWithID

func GetUsernameWithID(id int) string

Types

type RegistrationResponse

type RegistrationResponse struct {
	Error wings.RegistrationError `json:"error"`
	User  UserObj                 `json:"user"`
}

RegistrationResponse - Response for registration attempt

func NewUser

func NewUser(newUser wings.NewUser) RegistrationResponse

type RegistrationResponses

type RegistrationResponses []RegistrationResponse

RegistrationResponses - An array of RegistrationResponse

type UserObj

type UserObj struct {
	ID          int             `json:"id"`
	Details     wings.UserBasic `json:"details"`
	Trips       []trip.TripObj  `json:"trips"`
	TimeCreated time.Time       `json:"time_created"`
}

UserObj - All information of a single user.

func DummyUserObj

func DummyUserObj() UserObj

func GetUserObj

func GetUserObj(id int, self int) UserObj

func GetUserObjWithEmail deprecated

func GetUserObjWithEmail(email string) UserObj

Deprecated: This bypasses proper privacy checks.

func GetUserObjWithUsername

func GetUserObjWithUsername(username string, self int) UserObj

func UpdateUserObj

func UpdateUserObj(toUpdate wings.UserBasic, self int) UserObj

func (UserObj) GetID

func (user UserObj) GetID() int

GetID (istruct) - Returns the user ID.

func (*UserObj) SetID

func (user *UserObj) SetID(id int)

SetID (istruct) - Sets the user ID.

type UserObjs

type UserObjs []UserObj

UserObjs - An array of UserObj

Jump to

Keyboard shortcuts

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