users

package
v0.0.0-...-f5cdc36 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentUser

type CommentUser struct {
	UserID    string `json:"userId"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Email     string `json:"email"`
	Avatar    string `json:"avatar"`
	Role      string `json:"role"`
}

func (*CommentUser) FromProto

func (u *CommentUser) FromProto(user *users.User)

type RequestCtxSession

type RequestCtxSession struct{}

type RequestCtxUser

type RequestCtxUser struct{}

type Service

type Service interface {
	GetByID(ctx context.Context, userUUID uuid.UUID) (*UserResponse, error)
	GetSessionByID(ctx context.Context, sessionID string) (*Session, error)
}

type ServiceImpl

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

func NewService

func NewService(
	logger logger.Logger,
) ServiceImpl

func (*ServiceImpl) GetByID

func (s *ServiceImpl) GetByID(ctx context.Context, userUUID uuid.UUID) (*UserResponse, error)

func (*ServiceImpl) GetSessionByID

func (s *ServiceImpl) GetSessionByID(ctx context.Context, sessionID string) (*Session, error)

type Session

type Session struct {
	SessionID string    `json:"session_id"`
	UserID    uuid.UUID `json:"user_id"`
}

func (*Session) FromProto

func (s *Session) FromProto(session *sessions.Session) (*Session, error)

type SessionMiddleware

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

func NewSessionMiddleware

func NewSessionMiddleware(logger logger.Logger, cfg *config.Config, service Service) SessionMiddleware

func (*SessionMiddleware) SessionMiddleware

func (m *SessionMiddleware) SessionMiddleware(next echo.HandlerFunc) echo.HandlerFunc

type UserResponse

type UserResponse struct {
	Role      *string    `json:"role"`
	Avatar    *string    `json:"avatar" validate:"max=250" swaggertype:"string"`
	CreatedAt *time.Time `json:"created_at"`
	UpdatedAt *time.Time `json:"updated_at"`
	FirstName string     `json:"first_name" validate:"required,min=3,max=25"`
	LastName  string     `json:"last_name" validate:"required,min=3,max=25"`
	Email     string     `json:"email" validate:"required,email"`
	UserID    uuid.UUID  `json:"user_id"`
}

Jump to

Keyboard shortcuts

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