api

package
v0.0.0-...-e8fae58 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package api control emigre api.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run() error

Run start server.

Types

type API

type API struct {
	// echo framework. it's manage api handlers.
	*echo.Echo
	// contains filtered or unexported fields
}

API is a structure that aggregates the necessary information for API execution.

func NewAPI

func NewAPI() *API

NewAPI return api struct.

type HealthController

type HealthController struct{}

HealthController is a controller for /health API.

func NewHealthController

func NewHealthController() *HealthController

NewHealthController returns a new HealthController struct.

type HealthResponse

type HealthResponse struct {
	//	@Description	Name is server name.
	Name string `json:"name"`
	//	@Description	Version is repository tag version
	Version string `json:"version"`
	//	@Description	Revision is git revision
	Revision string `json:"revision"`
}

HealthResponse is response for GET /health

type UserController

type UserController struct {
	// Creator is an usecase for creating users.
	Creator usecase.UserCreator
}

UserController is a controller for /users API.

func NewUserController

func NewUserController(u *di.User) *UserController

NewUserController returns a new UserController struct.

type UserCreatorPayload

type UserCreatorPayload struct {
	//	@Description	name of user
	Name string `json:"name"`
	//	@Description	email address of user
	Email string `json:"email"`
	//	@Description	biography of user
	Biography string `json:"biography"`
}

UserCreatorPayload is a payload for POST /users

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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