Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	*echo.Group
	Deps *Dependencies
}

func New

func New(deps *Dependencies) *API

func (API) Connect

func (h API) Connect(c echo.Context) error

func (API) FederatedLogin

func (h API) FederatedLogin(c echo.Context) error

func (API) GetKey

func (h API) GetKey(c echo.Context) error

func (API) LocalLogin

func (h API) LocalLogin(c echo.Context) error

func (API) Login

func (h API) Login(c echo.Context) error

func (API) Register

func (h API) Register(c echo.Context) error

type ConnectData

type ConnectData struct {
	Target string `validate:"required"`
}

type ConnectResponse

type ConnectResponse struct {
	Token string `json:"token"`
}

type Dependencies

type Dependencies struct {
	Router      *routing.Router
	APIGroup    *echo.Group
	Socket      *socket.Handler
	DB          db.IHarmonyDB
	Logger      logger.ILogger
	AuthManager *auth.Manager
	Sonyflake   *sonyflake.Sonyflake
	Config      *config.Config
}

type LoginData

type LoginData struct {
	AuthToken string `validate:"required_without=Email"`
	Domain    string `validate:"required_without=Email"`
	Email     string `validate:"required_without=AuthToken"`
	Password  string `validate:"required_without=AuthToken"`
}

type RegisterData

type RegisterData struct {
	Email    string `validate:"required,email"`
	Username string `validate:"required"`
	Password string `validate:"required"`
}