handler

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package handler defines the gRPC endpoint handlers for the Users service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MongoURL string `json:"mongourl"`
}

Config contains the configuration for an instance of the Users service handlers.

type Users

type Users struct {
	*Config
	*micro.Service
	// contains filtered or unexported fields
}

Users defines the Users service.

func New

func New(conf *Config, service *micro.Service) (*Users, error)

New creates a new instance of the Users service handlers.

func (*Users) Create

func (u *Users) Create(ctx context.Context, in *users.User, out *users.User) error

Create inserts a new User object into the database.

func (*Users) Read

func (u *Users) Read(ctx context.Context, in *users.User, out *users.User) error

Read gets a User object from the database by ID or email address.

func (*Users) Update

func (u *Users) Update(ctx context.Context, in *users.User, out *users.User) error

Update updates a User object stored in the database.

Jump to

Keyboard shortcuts

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