pb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FuncRegister      = "register"
	FuncLogin         = "login"
	FuncCheckToken    = "checkToken"
	FuncGetProfile    = "getProfile"
	FuncUpdateProfile = "updateProfile"
	FuncLogout        = "logout"
)

Variables

View Source
var (
	Register      func(request RegisterRequest) (RegisterResponse, error)
	Login         func(request LoginRequest) (LoginResponse, error)
	CheckToken    func(request CheckTokenRequest) (CheckTokenResponse, error)
	GetProfile    func(request GetProfileRequest) (GetProfileResponse, error)
	UpdateProfile func(request UpdateProfileRequest) (UpdateProfileResponse, error)
	Logout        func(request LogoutRequest) (LogoutResponse, error)
)

Functions

This section is empty.

Types

type CheckTokenRequest

type CheckTokenRequest struct {
	Token string `json:"token,omitempty"`
}

type CheckTokenResponse

type CheckTokenResponse struct {
	Code int32  `json:"code,omitempty"`
	Msg  string `json:"msg,omitempty"`
}

type GetProfileRequest

type GetProfileRequest struct {
	Token string `json:"token,omitempty"`
}

type GetProfileResponse

type GetProfileResponse struct {
	Code int32  `json:"code,omitempty"`
	Msg  string `json:"msg,omitempty"`
	User User   `json:"user,omitempty"`
}

type LoginRequest

type LoginRequest struct {
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

type LoginResponse

type LoginResponse struct {
	Code  int32  `json:"code,omitempty"`
	Msg   string `json:"msg,omitempty"`
	Token string `json:"token,omitempty"`
	User  *User  `json:"user,omitempty"`
}

type LogoutRequest

type LogoutRequest struct {
	Token string `json:"token,omitempty"`
}

type LogoutResponse

type LogoutResponse struct {
	Code int32  `json:"code,omitempty"`
	Msg  string `json:"msg,omitempty"`
}

type RegisterRequest

type RegisterRequest struct {
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

type RegisterResponse

type RegisterResponse struct {
	Code int32  `json:"code,omitempty"`
	Msg  string `json:"msg,omitempty"`
}

type UpdateProfileRequest

type UpdateProfileRequest struct {
	Token          string `json:"token,omitempty"`
	Username       string `json:"username,omitempty"`
	ProfilePicture string `json:"profile_picture,omitempty"`
}

type UpdateProfileResponse

type UpdateProfileResponse struct {
	Code int32  `json:"code,omitempty"`
	Msg  string ` json:"msg,omitempty"`
}

type User

type User struct {
	Id             int64  `json:"id,omitempty"`
	Username       string `json:"username,omitempty"`
	ProfilePicture string `json:"profile_picture,omitempty"`
}

Jump to

Keyboard shortcuts

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