restapi

package
v0.0.0-...-ed588b7 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(authService *auth.Service, userRepo muser.Repository, taskRepo statstask.Repository, producer *taskqueue.Producer, timeout time.Duration) http.Handler

Types

type CreateStatsTaskOutput

type CreateStatsTaskOutput struct {
	ID uuid.UUID `json:"id"`
}

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
	Code    int    `json:"code"`
}

type GetMyselfOutput

type GetMyselfOutput = UserOutput

type GetTaskStatusOutput

type GetTaskStatusOutput struct {
	ID          uuid.UUID `json:"id"`
	Status      string    `json:"status"`
	DocumentURL string    `json:"document_url,omitempty"`
}

type GetUsersOutput

type GetUsersOutput struct {
	Users []UserOutput `json:"users"`
}

type IssueAccessToken

type IssueAccessToken struct {
	AccessToken string `json:"access_token"`
}

type RegisterInput

type RegisterInput struct {
	Username string  `json:"username"`
	Avatar   *string `json:"avatar"`
	Sex      string  `json:"sex"`
	Email    string  `json:"email"`
}

type RegisterOutput

type RegisterOutput struct {
	RefreshToken string `json:"refresh_token"`
}

type Response

type Response struct {
	Result interface{}    `json:"result,omitempty"`
	Error  *ErrorResponse `json:"error,omitempty"`
}

type UpdateMyselfInput

type UpdateMyselfInput struct {
	Username string  `json:"username"`
	Avatar   *string `json:"avatar"`
	Sex      string  `json:"sex"`
	Email    string  `json:"email"`
}

type UpdateMyselfOutput

type UpdateMyselfOutput = UserOutput

type UserOutput

type UserOutput struct {
	ID       uuid.UUID `json:"id"`
	Username string    `json:"username"`
	Avatar   *string   `json:"avatar,omitempty"`
	Sex      string    `json:"sex"`
	Email    string    `json:"email"`
}

Jump to

Keyboard shortcuts

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