api

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API holds all the dependencies required to expose APIs. And each API is a function with *API as its receiver

func NewService

func NewService(l logger.Logger, us *users.Users) (*API, error)

NewService returns a new instance of API with all the dependencies initialized

func (*API) CreateUser

func (a *API) CreateUser(ctx context.Context, u *users.User) (*users.User, error)

CreateUser is the API to create/signup a new user

func (*API) Health

func (a *API) Health() (map[string]interface{}, error)

Health returns the health of the app along with other info like version

func (*API) ReadUserByEmail

func (a *API) ReadUserByEmail(ctx context.Context, email string) (*users.User, error)

ReadUserByEmail is the API to read an existing user by their email

Jump to

Keyboard shortcuts

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