profile

package
v0.0.0-...-9841d36 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRequest

type CreateRequest struct {
	UserID   string `json:"user_id"`
	FullName string `json:"full_name"`
	Email    string `json:"email"`
	Phone    string `json:"phone"`
	Consent  bool   `json:"consent"`
}

func (*CreateRequest) ToProfile

func (cr *CreateRequest) ToProfile() (*domain.Profile, error)

func (*CreateRequest) Validate

func (cr *CreateRequest) Validate() error

type EditRequest

type EditRequest struct {
	Email    domain.Contact  `json:"email"`
	Phone    domain.Contact  `json:"phone"`
	Personal domain.Personal `json:"personal"`
	Metadata domain.Metadata `json:"metadata"`
}

func (*EditRequest) ToProfile

func (cr *EditRequest) ToProfile() (*domain.Profile, error)

type FetchResponse

type FetchResponse struct {
	domain.Profile
}

func NewFetchResponse

func NewFetchResponse(d domain.Profile, _ *service.ProfileService) *FetchResponse

NewFetchResponse instantiate a new response post load

type Handler

type Handler struct{}

Handler is just a route collection

func (Handler) CreateProfile

func (h Handler) CreateProfile(logger *log.Logger, ds *service.ProfileService) func(c *routing.Context) error

func (Handler) EditProfile

func (h Handler) EditProfile(logger *log.Logger, ds *service.ProfileService, a authentication.Service) func(c *routing.Context) error

func (Handler) Get

func (h Handler) Get(logger *log.Logger, ds *service.ProfileService) func(c *routing.Context) error

Get - load profile by ID

func (Handler) GetByOwner

func (h Handler) GetByOwner(logger *log.Logger, ds *service.ProfileService, a authentication.Service) func(c *routing.Context) error

GetByOwner - load profile by owner ID

func (Handler) Routes

Jump to

Keyboard shortcuts

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