user

package
v0.0.0-...-84e6723 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 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 Service

type Service interface {
	Get(ctx context.Context, id uuid.UUID) (*ent.User, error)
	Create(ctx context.Context, user model.AddUserInput) (*ent.User, error)
}

The Service interface defines all available methods the service offers.

func New

func New(client *db.Client) Service

New initializes the user service with the given DB client.

type User

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

The User service acts as a wrapper for the service methods.

func (*User) Create

func (s *User) Create(ctx context.Context, user model.AddUserInput) (*ent.User, error)

Create saves a new user with the given input.

func (*User) Get

func (s *User) Get(ctx context.Context, id uuid.UUID) (*ent.User, error)

Get retrieves a user by its ID.

Jump to

Keyboard shortcuts

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