Documentation ¶
Overview ¶
package v3 contains types to use across the Consumer/Provider tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type LoginRequest ¶
type LoginRequest struct { Username string `json:"username" pact:"example=jmarie"` Password string `json:"password" pact:"example=issilly"` }
LoginRequest is the login request API struct.
type LoginResponse ¶
type LoginResponse struct {
User *User `json:"user"`
}
LoginResponse is the login response API struct.
type User ¶
type User struct { Name string `json:"name" pact:"example=Jean-Marie de La Beaujardière😀😍"` Username string `json:"username" pact:"example=jmarie"` Password string `json:"password" pact:"example=password123"` Type string `json:"type" pact:"example=admin,regex=^(admin|user|guest)$"` ID int `json:"id" pact:"example=10"` }
User is a representation of a User. Dah.
type UserRepository ¶
UserRepository is an in-memory user database.
func (*UserRepository) ByID ¶
func (u *UserRepository) ByID(ID int) (*User, error)
ByID finds a user by their ID
func (*UserRepository) ByUsername ¶
func (u *UserRepository) ByUsername(username string) (*User, error)
ByUsername finds a user by their username.
Click to show internal directories.
Click to hide internal directories.