Documentation ¶
Index ¶
- func AsErrNoRecord(e error) bool
- type CacheService
- type ErrDuplicateEntry
- type ErrNoRecord
- type Event
- type EventService
- type IGNService
- type ParticipationService
- type PostgresService
- func (ps *PostgresService) AddParticipation(userID, eventID string, particpating bool) (string, error)
- func (ps *PostgresService) CreateEvent(name, eventType string, start, end time.Time, gid string, active bool) (string, error)
- func (ps *PostgresService) CreateIGN(userID, ign string) error
- func (ps *PostgresService) DeleteEvent(id string) error
- func (ps *PostgresService) DeleteParticipation(id string) error
- func (ps *PostgresService) DeleteParticipationByUserAndEvent(uid, eid string) error
- func (ps *PostgresService) DeleteRelation(userID string) error
- func (ps *PostgresService) GetEvent(id string) (*Event, error)
- func (ps *PostgresService) GetIGN(userID string) (string, error)
- func (ps *PostgresService) GetParticipation(uid, eid string) (string, bool, error)
- func (ps *PostgresService) GetRoleRequirementForGuild(action string, gid string) (string, error)
- func (ps *PostgresService) ListActiveEventsForGuild(gid string) ([]*Event, error)
- func (ps *PostgresService) ListAllEvent() ([]*Event, error)
- func (ps *PostgresService) ListAllIGN() (map[string]string, error)
- func (ps *PostgresService) ListEventsForGuild(gid string) ([]*Event, error)
- func (ps *PostgresService) ListUserForEvent(eid string) (yes, no map[string]string, e error)
- func (ps *PostgresService) SetEventEndDate(id string, end time.Time) error
- func (ps *PostgresService) SetEventStatus(id string, status bool) error
- func (ps *PostgresService) SetParticipation(id string, status bool) error
- func (ps *PostgresService) SetParticipationByUserAndEvent(uid, eid string, status bool) error
- func (ps *PostgresService) UpdateEvent(id, name, eventType string, start, end time.Time, gid string, active bool) error
- func (ps *PostgresService) UpdateIGN(userID, newIGN string) error
- func (ps *PostgresService) UserBailedEvent(uid, eid string) (bool, error)
- func (ps *PostgresService) UserInEvent(uid, eid string) (bool, error)
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsErrNoRecord ¶
Types ¶
type CacheService ¶
type CacheService struct { Service // contains filtered or unexported fields }
func NewWithCache ¶
func (*CacheService) GetRoleRequirementForGuild ¶
func (s *CacheService) GetRoleRequirementForGuild(action string, gid string) (string, error)
type ErrDuplicateEntry ¶
type ErrDuplicateEntry struct{ M string }
func (*ErrDuplicateEntry) Error ¶
func (e *ErrDuplicateEntry) Error() string
type ErrNoRecord ¶
type ErrNoRecord struct{}
func (*ErrNoRecord) Error ¶
func (e *ErrNoRecord) Error() string
type EventService ¶
type EventService interface { CreateEvent( name, eventType string, start, end time.Time, gid string, active bool, ) (string, error) UpdateEvent(id, name, eventType string, start, end time.Time, gid string, active bool) error SetEventStatus(id string, status bool) error SetEventEndDate(id string, end time.Time) error GetEvent(id string) (*Event, error) ListAllEvent() ([]*Event, error) ListEventsForGuild(gid string) ([]*Event, error) ListActiveEventsForGuild(gid string) ([]*Event, error) DeleteEvent(id string) error }
type IGNService ¶
type ParticipationService ¶
type ParticipationService interface { AddParticipation(userID, eventID string, participating bool) (string, error) DeleteParticipation(id string) error DeleteParticipationByUserAndEvent(uid, eid string) error ListUserForEvent(eid string) (map[string]string, map[string]string, error) UserInEvent(uid, eid string) (bool, error) SetParticipation(id string, status bool) error SetParticipationByUserAndEvent(uid, eid string, status bool) error GetParticipation(uid, eid string) (string, bool, error) }
type PostgresService ¶
type PostgresService struct { DB *sqlx.DB ActionRoleTable string Logger *zap.Logger IGNTable string EventsTable string ParticipationTable string }
func (*PostgresService) AddParticipation ¶
func (ps *PostgresService) AddParticipation( userID, eventID string, particpating bool, ) (string, error)
func (*PostgresService) CreateEvent ¶
func (*PostgresService) CreateIGN ¶
func (ps *PostgresService) CreateIGN(userID, ign string) error
IGN relation CRUD
func (*PostgresService) DeleteEvent ¶
func (ps *PostgresService) DeleteEvent(id string) error
func (*PostgresService) DeleteParticipation ¶
func (ps *PostgresService) DeleteParticipation(id string) error
func (*PostgresService) DeleteParticipationByUserAndEvent ¶
func (ps *PostgresService) DeleteParticipationByUserAndEvent(uid, eid string) error
func (*PostgresService) DeleteRelation ¶
func (ps *PostgresService) DeleteRelation(userID string) error
func (*PostgresService) GetParticipation ¶
func (ps *PostgresService) GetParticipation(uid, eid string) (string, bool, error)
func (*PostgresService) GetRoleRequirementForGuild ¶
func (ps *PostgresService) GetRoleRequirementForGuild(action string, gid string) (string, error)
GetRoleRequirementForGuild returns empty string if there's no requirement
func (*PostgresService) ListActiveEventsForGuild ¶
func (ps *PostgresService) ListActiveEventsForGuild(gid string) ([]*Event, error)
func (*PostgresService) ListAllEvent ¶
func (ps *PostgresService) ListAllEvent() ([]*Event, error)
func (*PostgresService) ListAllIGN ¶
func (ps *PostgresService) ListAllIGN() (map[string]string, error)
func (*PostgresService) ListEventsForGuild ¶
func (ps *PostgresService) ListEventsForGuild(gid string) ([]*Event, error)
func (*PostgresService) ListUserForEvent ¶
func (ps *PostgresService) ListUserForEvent(eid string) (yes, no map[string]string, e error)
func (*PostgresService) SetEventEndDate ¶
func (ps *PostgresService) SetEventEndDate(id string, end time.Time) error
func (*PostgresService) SetEventStatus ¶
func (ps *PostgresService) SetEventStatus(id string, status bool) error
func (*PostgresService) SetParticipation ¶
func (ps *PostgresService) SetParticipation(id string, status bool) error
func (*PostgresService) SetParticipationByUserAndEvent ¶
func (ps *PostgresService) SetParticipationByUserAndEvent(uid, eid string, status bool) error
func (*PostgresService) UpdateEvent ¶
func (*PostgresService) UpdateIGN ¶
func (ps *PostgresService) UpdateIGN(userID, newIGN string) error
func (*PostgresService) UserBailedEvent ¶
func (ps *PostgresService) UserBailedEvent(uid, eid string) (bool, error)
func (*PostgresService) UserInEvent ¶
func (ps *PostgresService) UserInEvent(uid, eid string) (bool, error)
type Service ¶
type Service interface { GetRoleRequirementForGuild(action string, gid string) (string, error) IGNService EventService ParticipationService }
Click to show internal directories.
Click to hide internal directories.