Documentation ¶
Index ¶
- type UpdateUserSpec
- type UserListParamParser
- type UserService
- func (svc UserService) Create(ctx context.Context, userSpec UserSpec) (*UserSpec, error)
- func (svc UserService) DeleteByUserId(ctx context.Context, userId string) error
- func (svc UserService) GetByUserId(ctx context.Context, userId string) (*UserSpec, error)
- func (svc UserService) List(ctx context.Context, listParams service.ListParams) ([]UserSpec, error)
- func (svc UserService) Routes() ([]service.Route, error)
- func (svc UserService) UpdateByUserId(ctx context.Context, userId string, userSpec UpdateUserSpec) (*UserSpec, error)
- type UserSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UpdateUserSpec ¶
type UpdateUserSpec struct {
Email *string `json:"email"`
}
func (UpdateUserSpec) ToUpdateObjectSpec ¶
func (updateSpec UpdateUserSpec) ToUpdateObjectSpec() *object.UpdateObjectSpec
type UserListParamParser ¶
type UserListParamParser struct{}
func (UserListParamParser) GetDefaultSortBy ¶
func (parser UserListParamParser) GetDefaultSortBy() string
func (UserListParamParser) GetSupportedSortBys ¶
func (parser UserListParamParser) GetSupportedSortBys() []string
func (UserListParamParser) ParseValue ¶
func (parser UserListParamParser) ParseValue(val string, sortBy string) (interface{}, error)
type UserService ¶
type UserService struct { service.BaseService // contains filtered or unexported fields }
func NewService ¶
func NewService(env service.Env, objectSvc object.Service) *UserService
func (UserService) DeleteByUserId ¶
func (svc UserService) DeleteByUserId(ctx context.Context, userId string) error
func (UserService) GetByUserId ¶
func (UserService) List ¶
func (svc UserService) List(ctx context.Context, listParams service.ListParams) ([]UserSpec, error)
func (UserService) UpdateByUserId ¶
func (svc UserService) UpdateByUserId(ctx context.Context, userId string, userSpec UpdateUserSpec) (*UserSpec, error)
type UserSpec ¶
type UserSpec struct { UserId string `json:"userId" validate:"omitempty,valid_object_id"` Email *string `json:"email"` CreatedAt time.Time `json:"createdAt"` }
func NewUserSpecFromObjectSpec ¶
func NewUserSpecFromObjectSpec(objectSpec *object.ObjectSpec) (*UserSpec, error)
func (UserSpec) ToCreateObjectSpec ¶
func (spec UserSpec) ToCreateObjectSpec() (*object.CreateObjectSpec, error)
Click to show internal directories.
Click to hide internal directories.