user

package
v0.0.0-...-c4bde49 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FollowEndpoint

func FollowEndpoint(s realworld.UserService) endpoint.Endpoint

func GetProfileEndpoint

func GetProfileEndpoint(s realworld.UserService) endpoint.Endpoint

func LoginEndpoint

func LoginEndpoint(s realworld.UserService) endpoint.Endpoint

func RegisterEndpoint

func RegisterEndpoint(s realworld.UserService) endpoint.Endpoint

func UnfollowEndpoint

func UnfollowEndpoint(s realworld.UserService) endpoint.Endpoint

func UpdateEndpoint

func UpdateEndpoint(s realworld.UserService) endpoint.Endpoint

Types

type GetRequest

type GetRequest struct {
	ID int64
}

type LoginRequest

type LoginRequest struct {
	Email    string
	Password string
}

type ProfileRequest

type ProfileRequest struct {
	Username string
	ViewerID int64
}

type ProfileResponse

type ProfileResponse struct {
	ID        int64
	Username  string
	Bio       realworld.Bio
	Image     realworld.Image
	Following bool
	Err       error
}

func NewProfileResponse

func NewProfileResponse(u *realworld.User, viewerID int64, err error) ProfileResponse

func (ProfileResponse) Failed

func (r ProfileResponse) Failed() error

type RegisterRequest

type RegisterRequest struct {
	Username string
	Email    string
	Password string
}

type Response

type Response struct {
	ID       int64
	Username string
	Email    string
	Bio      realworld.Bio
	Image    realworld.Image
	Err      error
}

func NewResponse

func NewResponse(u *realworld.User, err error) Response

func (Response) Failed

func (r Response) Failed() error

type Service

type Service struct {
	UserRepo realworld.UserRepo
}

func (Service) Follow

func (s Service) Follow(req realworld.FollowRequest) (*realworld.User, error)

func (Service) Get

func (s Service) Get(u realworld.User) (*realworld.User, error)

func (Service) GetProfile

func (s Service) GetProfile(user realworld.User) (*realworld.User, error)

func (Service) Login

func (s Service) Login(u realworld.User) (*realworld.User, error)

func (Service) Register

func (s Service) Register(u realworld.User) (*realworld.User, error)

func (Service) Unfollow

func (s Service) Unfollow(req realworld.FollowRequest) (*realworld.User, error)

func (Service) Update

func (s Service) Update(u realworld.User) (*realworld.User, error)

type UpdateRequest

type UpdateRequest struct {
	ID       int64
	Username string
	Password string
	Email    string
	Bio      realworld.Bio
	Image    realworld.Image
}

Jump to

Keyboard shortcuts

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