models

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrBadRequest

func IsErrBadRequest(err error) bool

func IsErrConflict

func IsErrConflict(err error) bool

func IsErrNotFound

func IsErrNotFound(err error) bool

Types

type ErrPetNotFound

type ErrPetNotFound struct {
	ID   string
	Name string
}

func (ErrPetNotFound) Error

func (err ErrPetNotFound) Error() string

type ErrShelterAlreadyExist

type ErrShelterAlreadyExist struct {
	ID   string
	Name string
}

func (ErrShelterAlreadyExist) Error

func (err ErrShelterAlreadyExist) Error() string

type ErrShelterNotFound

type ErrShelterNotFound struct {
	ID   string
	Name string
}

func (ErrShelterNotFound) Error

func (err ErrShelterNotFound) Error() string

type ErrUserAlreadyExist

type ErrUserAlreadyExist struct {
	Username string
	Email    string
}

func (ErrUserAlreadyExist) Error

func (err ErrUserAlreadyExist) Error() string

type ErrUserNotAuthenticated

type ErrUserNotAuthenticated struct{}

func (ErrUserNotAuthenticated) Error

func (err ErrUserNotAuthenticated) Error() string

type ErrUserNotFound

type ErrUserNotFound struct {
	ID       string
	Username string
	Email    string
}

func (ErrUserNotFound) Error

func (err ErrUserNotFound) Error() string

type ErrUserPasswordMismatch

type ErrUserPasswordMismatch struct{}

func (ErrUserPasswordMismatch) Error

type Pet

type Pet struct {
	XKey            string            `json:"_key"`
	ID              string            `json:"id"`
	Name            string            `json:"name"`
	Breed           string            `json:"breed"`
	Gender          string            `json:"gender"`
	Photo           string            `json:"photo"`
	AdoptionStatus  PetAdoptionStatus `json:"adoptionStatus"`
	ShelterID       string            `json:"shelterID""`
	OriginShelterID string            `json:"originShelterID"`
	// If CurrentOwnerID is set, user is the current owner,
	// but it previously belonged to the shelter with the ShelterID
	CurrentOwnerID string `json:"currentOwnerID"`
}

func (*Pet) APIFormat

func (pet *Pet) APIFormat() gqtypes.Pet

type PetAdoptionStatus

type PetAdoptionStatus int
const (
	PetAvailable PetAdoptionStatus = iota
	PetAdopted
)

func (PetAdoptionStatus) String

func (s PetAdoptionStatus) String() string

type Shelter

type Shelter struct {
	XKey               string `json:"_key"`
	ID                 string `json:"id"`
	Name               string `json:"name"`
	Description        string `json:"description"`
	Website            string `json:"website"`
	Location           string `json:"location"`
	ContactInformation string `json:"contactInformation"`
	NumberOfPets       int64  `json:"numberOfPets"`
	// Assuming a shelter can have only one owner
	OwnerID string `json:"ownerID"`
}

func (*Shelter) APIFormat

func (s *Shelter) APIFormat() gqtypes.Shelter

type StatusError

type StatusError struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

func (StatusError) Error

func (err StatusError) Error() string

type User

type User struct {
	XKey      string `json:"_key"`
	ID        string `json:"id"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Bio       string `json:"bio"`
	Location  string `json:"location"`
	Avatar    string `json:"avatar"`

	Username     string `json:"username"`
	Email        string `json:"email"`
	PasswordHash string `json:"passwordHash"`

	IsActive bool `json:"isActive"`
	IsAdmin  bool `json:"isAdmin"`

	CreatedUnix   int64 `json:"createdUnix"`
	UpdatedUnix   int64 `json:"updatedUnix"`
	LastLoginUnix int64 `json:"lastLoginUnix"`
}

func (*User) APIFormat

func (u *User) APIFormat() gqtypes.User

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL