Documentation ¶
Overview ¶
Package party contains party-related CRUD functionality
Index ¶
- Variables
- type Info
- type NewParty
- type Party
- func (p Party) Create(ctx context.Context, traceID string, np NewParty, now time.Time) (Info, error)
- func (p Party) Query(ctx context.Context, traceID string, pageNumber int, rowsPerPage int) ([]*Info, error)
- func (p Party) QueryByID(ctx context.Context, traceID string, partyID string) (*Info, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is used when a specific Party is requested but does not exist. ErrNotFound = errors.New("not found") // ErrInvalidID occurs when an ID is not in a valid form. ErrInvalidID = errors.New("ID is not in its proper form") // ErrForbidden occurs when a user tries to do something that is forbidden to them according to our access control policies. ErrForbidden = errors.New("attempted action is not allowed") )
Functions ¶
This section is empty.
Types ¶
type Info ¶
type Info struct { ID string `db:"party_id"` Name string `db:"name"` Location string `db:"location"` LfPlayers int `db:"lf_players"` LfGM int `db:"lf_gm"` Description string `db:"description"` DateCreated time.Time `db:"date_created"` DateUpdated time.Time `db:"date_updated"` }
Info represents a single meet.
type NewParty ¶
type NewParty struct { Name string `json:"name" validate:"required,max=255"` Description string `json:"description" validate:"required,min=50,max=1000"` Location string `json:"location" validate:"required,max=255"` LfPlayers int `json:"lf_players,string" validate:"required_without=LfGM,gte=0,lte=10"` LfGM int `json:"lf_gm,string" validate:"required_without=LfPlayers,gte=0,lte=10"` }
NewParty describes the required data for creating a new party.
type Party ¶
type Party struct {
// contains filtered or unexported fields
}
Party manages the set of API's for party access.
func (Party) Create ¶
func (p Party) Create(ctx context.Context, traceID string, np NewParty, now time.Time) (Info, error)
Create adds a Party to the database. It returns the created Party with fields like ID and DateCreated populated.
Click to show internal directories.
Click to hide internal directories.