Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateUserRequest ¶
type CreateUserRequest struct {
weaver.AutoMarshal
Username string
Password string
PasswordRepeat string
FirstName string
LastName string
Birthday string
Timezone string
Address string
State string
Zip string
Ssn string
}
CreateUserRequest contains data used for creating a new user.
func (*CreateUserRequest) WeaverMarshal ¶
func (x *CreateUserRequest) WeaverMarshal(enc *codegen.Encoder)
func (*CreateUserRequest) WeaverUnmarshal ¶
func (x *CreateUserRequest) WeaverUnmarshal(dec *codegen.Decoder)
type LoginRequest ¶
type LoginRequest struct {
weaver.AutoMarshal
Username string
Password string
}
LoginRequest contains data used for logging in an existing user.
func (*LoginRequest) WeaverMarshal ¶
func (x *LoginRequest) WeaverMarshal(enc *codegen.Encoder)
func (*LoginRequest) WeaverUnmarshal ¶
func (x *LoginRequest) WeaverUnmarshal(dec *codegen.Decoder)
type T ¶
type T interface {
// CreateUser is used to create a new user.
CreateUser(ctx context.Context, r CreateUserRequest) error
// Login logs in an existing user and returns a signed JWT on success.
Login(ctx context.Context, r LoginRequest) (string, error)
}
type User ¶
type User struct {
weaver.AutoMarshal
AccountID string `gorm:"column:accountid;primary_key"`
Username string `gorm:"unique;not null"`
Passhash []byte `gorm:"not null"`
Firstname string `gorm:"not null"`
Lastname string `gorm:"not null"`
Birthday string `gorm:"not null"`
Timezone string `gorm:"not null"`
Address string `gorm:"not null"`
State string `gorm:"not null"`
Zip string `gorm:"not null"`
SSN string `gorm:"not null"`
}
User contains data pertaining to a user.
func (*User) WeaverMarshal ¶
func (*User) WeaverUnmarshal ¶
Click to show internal directories.
Click to hide internal directories.