http_service

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EditUserRequest

type EditUserRequest struct {
	SessionID  string `form:"session_id"`
	Nickname   string `form:"nickname" binding:"min=6,max=64"`
	ProfilePic string `form:"profile_pic" binding:"max=1024"`
}

type EditUserResponse

type EditUserResponse struct{}

type GetUserRequest

type GetUserRequest struct {
	SessionID string `form:"session_id"`
}

type GetUserResponse

type GetUserResponse struct {
	Username   string `json:"username"`
	Nickname   string `json:"nickname"`
	ProfilePic string `json:"profile_pic"`
}

type LoginRequest

type LoginRequest struct {
	Username string `form:"username" binding:"required,min=6,max=64"`
	Password string `form:"password" binding:"required,min=6,max=64"`
}

type LoginResponse

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

type RegisterUserRequest

type RegisterUserRequest struct {
	Username   string `form:"username" binding:"required,min=6,max=64"`
	Password   string `form:"password" binding:"required,min=6,max=64"`
	Nickname   string `form:"nickname" binding:"required,min=6,max=64"`
	ProfilePic string `form:"profile_pic" binding:"-"` // Skip validation.
}

type RegisterUserResponse

type RegisterUserResponse struct{}

type Service

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

func New

func New(ctx context.Context) Service

func (*Service) AuthUser

func (svc *Service) AuthUser(sessionID string) (string, error)

func (*Service) EditUser

func (svc *Service) EditUser(param *EditUserRequest) (*EditUserResponse, error)

func (*Service) GetUser

func (svc *Service) GetUser(param *GetUserRequest) (*GetUserResponse, error)

func (*Service) Login

func (svc *Service) Login(param *LoginRequest) (*LoginResponse, error)

func (*Service) Register

func (svc *Service) Register(param *RegisterUserRequest) (*RegisterUserResponse, error)

func (*Service) UploadFile

func (svc *Service) UploadFile(fileType int, file multipart.File, fileHeader *multipart.FileHeader) (*UploadFileResponse, error)

type UploadFileRequest

type UploadFileRequest struct {
}

type UploadFileResponse

type UploadFileResponse struct {
	FileName string `json:"file_name"`
	FileUrl  string `json:"file_url"`
}

Jump to

Keyboard shortcuts

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