dexes

package
v1.31.5-0...-ff97089 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(e *echo.Echo, db *pg.DB, enforceAuth echo.MiddlewareFunc, nonEnforceAuth echo.MiddlewareFunc)

RegisterRoutes takes in an Echo router and registers routes onto it.

Types

type DeleteDexOptions

type DeleteDexOptions struct {
	ID     int
	UserID int
}

type Dex

type Dex struct {
	ID           int               `json:"id"`
	UserID       int               `json:"user_id"`
	Title        string            `json:"title"`
	Slug         string            `json:"slug"`
	Shiny        bool              `pg:",use_zero" json:"shiny"`
	GameID       string            `json:"-"`
	Game         *games.Game       `pg:"g,rel:has-one" json:"game"`
	DexTypeID    int               `json:"-"`
	DexType      *dextypes.DexType `pg:"dt,rel:has-one" json:"dex_type"`
	Regional     *bool             `json:"regional"`
	Caught       int               `pg:"-" json:"caught"`
	Total        int               `pg:"-" json:"total"`
	DateCreated  time.Time         `json:"date_created"`
	DateModified time.Time         `json:"date_modified"`
	// contains filtered or unexported fields
}

func (*Dex) MarshalJSON

func (d *Dex) MarshalJSON() ([]byte, error)

MarshalJSON is just needed for parity testing. Once we're actually using this in production, we can remove it.

type RetrieveDexOptions

type RetrieveDexOptions struct {
	ID       *int
	Slug     *string
	Username *string

	IncludeDexTypePokemon bool
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(db *pg.DB) *Service

func (*Service) CreateDex

func (svc *Service) CreateDex(ctx context.Context, dex *Dex) error

func (*Service) DeleteDex

func (svc *Service) DeleteDex(ctx context.Context, opts DeleteDexOptions) error

func (*Service) RetrieveDex

func (svc *Service) RetrieveDex(ctx context.Context, opts RetrieveDexOptions) (*Dex, error)

func (*Service) UpdateDex

func (svc *Service) UpdateDex(ctx context.Context, dex *Dex, opts UpdateDexOptions) error

type UpdateDexOptions

type UpdateDexOptions struct {
	Columns         []string
	UpdatingDexType bool
}

Jump to

Keyboard shortcuts

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