Skip to content

Latest commit

 

History

History
56 lines (39 loc) · 981 Bytes

File metadata and controls

56 lines (39 loc) · 981 Bytes

UserMainService

A velocity which will be handling user main data.

Functions

Add

Takes in user data, then add it into database. Returns user ID.

addResponse, err := client.Add(ctx, &UserData)

Get

Takes in either user ID, username or email, then returns user data.

getResponse, err := client.Get(ctx, &proto.GetRequest{
    Username: "username",
    UserID: "userid",
    Email: "email", // Either can be given
})

Update

Takes in user ID and data to update.

updateResponse, err := client.Update(ctx, &proto.UpdateRequest{
    UserID: "Userid",
    Update: UpdateData,
})

Auth

Takes in either username or email and password. Then returns if credentials are valid.

authResponse, err := client.Auth(ctx, &proto.AuthRequest{
    Username: "Username",
    Email: "Email",
    Password: "password",
})

Validate

Takes in data and returns if it is valid.

valid, _ := client.Validate(ctx, &UserData)