userservice

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppLike added in v0.0.5

type AppLike interface {
	DB() app.DBClient
	Key() string
}

type LoginData

type LoginData struct {
	Login    string `json:"login"`
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	Token   string    `json:"token"`
	Expires time.Time `json:"expires"`
}

type UserService

type UserService struct {
	DB     func() app.DBClient
	AppKey func() string
}

func New added in v0.0.5

func New(app AppLike) *UserService

func (*UserService) Login

func (u *UserService) Login(c app.Context, loginData *LoginData) (*LoginResponse, error)

func (*UserService) Logout

func (u *UserService) Logout(c app.Context, _ *any) (*any, error)

func (*UserService) Me

func (u *UserService) Me(c app.Context, _ *any) (*app.User, error)

Jump to

Keyboard shortcuts

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