Documentation
¶
Index ¶
- type CreateInput
- type Handlers
- type Public
- type Service
- func (s *Service) Create(ctx context.Context, in CreateInput, image *upload.File) (Public, error)
- func (s *Service) Delete(ctx context.Context, id int) (Public, error)
- func (s *Service) ForTeam(ctx context.Context, teamID int) ([]Public, error)
- func (s *Service) List(ctx context.Context) ([]Public, error)
- func (s *Service) ListMinimal(ctx context.Context) ([]Public, error)
- type Sponsor
- type Store
- func (s *Store) AddSponsor(ctx context.Context, sponsorParam Sponsor) (Sponsor, error)
- func (s *Store) DeleteSponsor(ctx context.Context, sponsorParam Sponsor) error
- func (s *Store) DetachTeam(ctx context.Context, teamID int) error
- func (s *Store) EditSponsor(ctx context.Context, sponsorParam Sponsor) (Sponsor, error)
- func (s *Store) GetSponsor(ctx context.Context, sponsorParam Sponsor) (Sponsor, error)
- func (s *Store) GetSponsors(ctx context.Context) ([]Sponsor, error)
- func (s *Store) GetSponsorsMinimal(ctx context.Context) ([]Sponsor, error)
- func (s *Store) GetSponsorsTeam(ctx context.Context, teamParam team.Team) ([]Sponsor, error)
- type TeamGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateInput ¶
CreateInput is a new sponsor; an image is required.
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers serves /sponsors.
func NewHandlers ¶
type Public ¶
type Public struct {
ID int `json:"id"`
Name string `json:"name"`
Website string `json:"website,omitempty"`
Purpose string `json:"purpose,omitempty"`
Team string `json:"team,omitempty"`
ImageURL string `json:"imageUrl,omitempty"`
}
Public is a sponsor as the API returns it. Team is "A", "O" or "Y" (legacy audience codes) or a team ID as a string; empty means unassigned.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the sponsor business logic.
func NewService ¶
func NewService(store store, teams TeamGetter, files *upload.Files) *Service
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store stores the dependencies
func (*Store) AddSponsor ¶
func (*Store) DeleteSponsor ¶
func (*Store) DetachTeam ¶
DetachTeam makes every sponsor of teamID club-wide ("A").
func (*Store) EditSponsor ¶
func (*Store) GetSponsor ¶
func (*Store) GetSponsorsMinimal ¶
Click to show internal directories.
Click to hide internal directories.