user

package
v0.0.0-...-f1b04be Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2017 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package user provides means to manage the users.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository interface {
	Get(ctx context.Context, id string) (u User, err error)
	Put(ctx context.Context, user User) (id string, err error)
}

Repository provides a limited interface to a user storage layer.

type Service

type Service interface {
	Get(ctx context.Context, id string) (u User, err error)
	AddUser(ctx context.Context, name string) (id string, err error)
}

Service is the interface that provides the basic User methods.

func NewService

func NewService(repo Repository) Service

NewService returns a new instance of the default user Service.

type User

type User struct {
	ID   string
	Name string
}

User represents one single user.

func New

func New(name string) User

New allocates an user and returns a pointer to it.

Jump to

Keyboard shortcuts

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