Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoUserInformation = errors.New("no user information")
Functions ¶
Types ¶
type DuplicateRecordError ¶
func (DuplicateRecordError) Error ¶
func (e DuplicateRecordError) Error() string
type InvalidError ¶
type InvalidError struct {
UUID string
}
func (InvalidError) Error ¶
func (e InvalidError) Error() string
type NotFoundError ¶
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string
type Repository ¶
type Repository interface { Create(ctx context.Context, u *User) (string, error) GetByEmail(ctx context.Context, email string) (User, error) GetByUUID(ctx context.Context, uuid string) (User, error) UpsertByEmail(ctx context.Context, u *User) (string, error) }
Repository contains interface of supported methods
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a type of service that manages business process
func NewService ¶
func NewService(logger log.Logger, repository Repository, opts ...func(*Service)) *Service
NewService initializes user service
type User ¶
type User struct { ID string `json:"-" diff:"-" db:"id"` UUID string `json:"uuid,omitempty" diff:"-" db:"uuid"` Email string `json:"email" diff:"email" db:"email"` Provider string `json:"provider" diff:"-" db:"provider"` CreatedAt time.Time `json:"-" diff:"-" db:"created_at"` UpdatedAt time.Time `json:"-" diff:"-" db:"updated_at"` }
User is a basic entity of a user
func FromContext ¶
FromContext returns the user ID from the context if present, and empty otherwise.
Click to show internal directories.
Click to hide internal directories.