api

package
v0.0.0-...-c7a98c3 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InternalError = sterr.New("occurred error, please try again later")

Functions

This section is empty.

Types

type CreateUserRequest

type CreateUserRequest struct {
	Username        string `json:"username" binding:"required,alphanum"`
	FullName        string `json:"full_name" binding:"required,alphanum"`
	Password        string `json:"password"`
	ConfirmPassword string `json:"confirm_password"`
	Email           string `json:"email"`
}

type Error

type Error struct {
	// contains filtered or unexported fields
}

type LoginRequest

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

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(store db.Querier, maker token.Maker) *Server

func (*Server) CreateUser

func (s *Server) CreateUser(ctx *gin.Context)

CreateUser user register view

func (*Server) Home

func (s *Server) Home(ctx *gin.Context)

Home view

func (*Server) Login

func (s *Server) Login(ctx *gin.Context)

Login handle view

func (*Server) Start

func (s *Server) Start(address string)

Start http server on address

type UserInfo

type UserInfo struct {
	SessionID       uuid.UUID `json:"session_id"`
	AccessToken     string    `json:"access_token"`
	AccessExpireAt  time.Time `json:"access_expire_at"`
	RefreshToken    string    `json:"refresh_token"`
	RefreshExpireAt time.Time `json:"refresh_expire_at"`
	Username        string    `json:"username"`
	FullName        string    `json:"full_name"`
	Email           string    `json:"email"`
	CreatedAt       time.Time `json:"created_at"`
}

Jump to

Keyboard shortcuts

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