api

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 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 API

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

func New added in v1.8.2

func New(us *users.Users, un *usernotes.UserNotes) *API

func (*API) AsyncCreateUsers added in v1.8.2

func (a *API) AsyncCreateUsers(ctx context.Context, users []users.User) error

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) CreateUserNote added in v1.8.2

func (a *API) CreateUserNote(ctx context.Context, un *usernotes.Note) (*usernotes.Note, error)

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

func (*API) ReadUserNote added in v1.8.2

func (a *API) ReadUserNote(ctx context.Context, userID string, noteID string) (*usernotes.Note, error)

func (*API) ServerHealth added in v1.8.2

func (a *API) ServerHealth() (map[string]any, error)

ServerHealth returns the health of the serever app along with other info like version

type Server added in v1.8.2

type Server interface {
	CreateUser(ctx context.Context, user *users.User) (*users.User, error)
	ReadUserByEmail(ctx context.Context, email string) (*users.User, error)
	CreateUserNote(ctx context.Context, un *usernotes.Note) (*usernotes.Note, error)
	ReadUserNote(ctx context.Context, userID string, noteID string) (*usernotes.Note, error)
	ServerHealth() (map[string]any, error)
}

Server has all the methods required to run the server

func NewServer added in v1.8.2

func NewServer(us *users.Users, un *usernotes.UserNotes) Server

type Subscriber added in v1.8.2

type Subscriber interface {
	AsyncCreateUsers(ctcx context.Context, users []users.User) error
}

Subscriber has all the methods required to run the subscriber

func NewSubscriber added in v1.8.2

func NewSubscriber(us *users.Users) Subscriber

Jump to

Keyboard shortcuts

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