Documentation
¶
Index ¶
- func RegisterRoutes(e *echo.Echo, cfg *config.Config, db *pg.DB, enforceAuth echo.MiddlewareFunc, ...)
- type ListUsersOptions
- type RetrieveUserOptions
- type Service
- func (svc *Service) CreateUserAndDex(ctx context.Context, user *User, dex *dexes.Dex) error
- func (svc *Service) ListUsers(ctx context.Context, opts ListUsersOptions) ([]*User, error)
- func (svc *Service) RetrieveUser(ctx context.Context, opts RetrieveUserOptions) (*User, error)
- func (svc *Service) UpdateUser(ctx context.Context, user *User, opts UpdateUserOptions) error
- type UpdateUserOptions
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutes ¶
func RegisterRoutes(e *echo.Echo, cfg *config.Config, db *pg.DB, enforceAuth echo.MiddlewareFunc, nonEnforceAuth echo.MiddlewareFunc)
RegisterRoutes takes in an Echo router and registers routes onto it.
Types ¶
type ListUsersOptions ¶
type RetrieveUserOptions ¶
type RetrieveUserOptions struct {
Username *string
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) CreateUserAndDex ¶
func (*Service) RetrieveUser ¶
func (*Service) UpdateUser ¶
type UpdateUserOptions ¶
type UpdateUserOptions struct {
Columns []string
}
type User ¶
type User struct {
ID int `json:"id"`
Username string `json:"username"`
FriendCode3DS *string `pg:"friend_code_3ds" json:"friend_code_3ds"`
FriendCodeSwitch *string `json:"friend_code_switch"`
Dexes []*dexes.Dex `pg:"rel:has-many" json:"dexes"`
Password string `json:"-"`
LastIP *string `json:"-"`
LastLogin *time.Time `json:"-"`
Referrer *string `json:"-"`
StripeID *string `json:"-"`
Donated bool `pg:"-" json:"donated"`
DateCreated time.Time `json:"date_created"`
DateModified time.Time `json:"date_modified"`
// contains filtered or unexported fields
}
func (*User) MarshalJSON ¶
MarshalJSON is just needed for parity testing. Once we're actually using this in production, we can remove it.
Click to show internal directories.
Click to hide internal directories.