services

package
v0.0.0-...-bdf6f31 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(mux *http.ServeMux)

Setup services

Types

type ChangePasswordPara

type ChangePasswordPara struct {
	UserID      string `json:"user_id"`
	OldPassword string `json:"old_password"`
	NewPassword string `json:"new_password"`
}

ChangePasswordPara contains the paramters to change user password

type GeneralEcho

type GeneralEcho struct {
	Result bool   `json:"result"`
	Error  string `json:"error"`
}

GeneralEcho is a general echo

type LoginPara

type LoginPara struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

LoginPara contains the parameters for login

type RegisterPara

type RegisterPara struct {
	Email    string `json:"email"`
	Name     string `json:"name"`
	Password string `json:"password"`
}

RegisterPara contains the parameters for registration

type SessionInfo

type SessionInfo struct {
	SessionID string    `json:"session_id"`
	UserID    string    `json:"user_id"`
	CreatedAt time.Time `json:"created_at"`
}

SessionInfo contains information of a session

type SessionPara

type SessionPara struct {
	SessionID string `json:"session_id"`
}

SessionPara contains the parameters for existing session

type SuccessEcho

type SuccessEcho struct {
	Result      bool        `json:"result"`
	UserInfo    UserInfo    `json:"user"`
	SessionInfo SessionInfo `json:"session"`
}

SuccessEcho is an echo with information of user and session when succeeded

type UserInfo

type UserInfo struct {
	UserID string `json:"user_id"`
	Email  string `json:"email"`
	Name   string `json:"name"`
}

UserInfo contains information of a user

type UserPara

type UserPara struct {
	UserID string `json:"user_id"`
}

UserPara contains the parameters for existing user

Jump to

Keyboard shortcuts

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