Documentation
¶
Index ¶
- func NewStorage(apiClient interfaces.APIClient) (interfaces.StorageRepository, error)
- type FirebaseStorage
- func (s *FirebaseStorage) AddParticipant(name, baekjoonID string, startTier, startRating int, organizationID int) error
- func (s *FirebaseStorage) CreateCompetition(name string, startDate, endDate time.Time) error
- func (s *FirebaseStorage) GetClient() interface{}
- func (s *FirebaseStorage) GetCompetition() *models.Competition
- func (s *FirebaseStorage) GetParticipants() []models.Participant
- func (s *FirebaseStorage) IsBlackoutPeriod() bool
- func (s *FirebaseStorage) RemoveParticipant(baekjoonID string) error
- func (s *FirebaseStorage) SaveCompetition() error
- func (s *FirebaseStorage) SaveParticipants() error
- func (s *FirebaseStorage) SetScoreboardVisibility(visible bool) error
- func (s *FirebaseStorage) UpdateCompetitionEndDate(endDate time.Time) error
- func (s *FirebaseStorage) UpdateCompetitionName(name string) error
- func (s *FirebaseStorage) UpdateCompetitionStartDate(startDate time.Time) error
- type InMemoryStorage
- func (s *InMemoryStorage) AddParticipant(name, baekjoonID string, startTier, startRating int, organizationID int) error
- func (s *InMemoryStorage) CreateCompetition(name string, startDate, endDate time.Time) error
- func (s *InMemoryStorage) GetCompetition() *models.Competition
- func (s *InMemoryStorage) GetParticipants() []models.Participant
- func (s *InMemoryStorage) IsBlackoutPeriod() bool
- func (s *InMemoryStorage) RemoveParticipant(baekjoonID string) error
- func (s *InMemoryStorage) SaveCompetition() error
- func (s *InMemoryStorage) SaveParticipants() error
- func (s *InMemoryStorage) SetScoreboardVisibility(visible bool) error
- func (s *InMemoryStorage) UpdateCompetitionEndDate(endDate time.Time) error
- func (s *InMemoryStorage) UpdateCompetitionName(name string) error
- func (s *InMemoryStorage) UpdateCompetitionStartDate(startDate time.Time) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStorage ¶
func NewStorage(apiClient interfaces.APIClient) (interfaces.StorageRepository, error)
NewStorage 새로운 FirebaseStorage 인스턴스를 생성하고 Firestore에 연결합니다.
Types ¶
type FirebaseStorage ¶
type FirebaseStorage struct {
// contains filtered or unexported fields
}
FirebaseStorage Firestore를 사용하여 데이터를 관리하는 저장소입니다.
func (*FirebaseStorage) AddParticipant ¶
func (s *FirebaseStorage) AddParticipant(name, baekjoonID string, startTier, startRating int, organizationID int) error
AddParticipant 새로운 참가자를 Firestore에 추가합니다.
func (*FirebaseStorage) CreateCompetition ¶
func (s *FirebaseStorage) CreateCompetition(name string, startDate, endDate time.Time) error
CreateCompetition 새로운 대회를 Firestore에 생성합니다.
func (*FirebaseStorage) GetClient ¶
func (s *FirebaseStorage) GetClient() interface{}
GetClient Firestore 클라이언트를 반환합니다 (헬스체크용)
func (*FirebaseStorage) GetCompetition ¶
func (s *FirebaseStorage) GetCompetition() *models.Competition
GetCompetition 현재 활성화된 대회를 Firestore에서 조회합니다.
func (*FirebaseStorage) GetParticipants ¶
func (s *FirebaseStorage) GetParticipants() []models.Participant
GetParticipants 현재 대회에 등록된 모든 참가자를 Firestore에서 조회합니다.
func (*FirebaseStorage) IsBlackoutPeriod ¶
func (s *FirebaseStorage) IsBlackoutPeriod() bool
func (*FirebaseStorage) RemoveParticipant ¶
func (s *FirebaseStorage) RemoveParticipant(baekjoonID string) error
RemoveParticipant 백준ID로 참가자를 Firestore에서 삭제합니다.
func (*FirebaseStorage) SaveCompetition ¶
func (s *FirebaseStorage) SaveCompetition() error
SaveCompetition Firestore에서 쓰기 작업이 즉시 이루어지므로 no-op입니다.
func (*FirebaseStorage) SaveParticipants ¶
func (s *FirebaseStorage) SaveParticipants() error
SaveParticipants Firestore에서 쓰기 작업이 즉시 이루어지므로 no-op입니다.
func (*FirebaseStorage) SetScoreboardVisibility ¶
func (s *FirebaseStorage) SetScoreboardVisibility(visible bool) error
func (*FirebaseStorage) UpdateCompetitionEndDate ¶
func (s *FirebaseStorage) UpdateCompetitionEndDate(endDate time.Time) error
func (*FirebaseStorage) UpdateCompetitionName ¶
func (s *FirebaseStorage) UpdateCompetitionName(name string) error
func (*FirebaseStorage) UpdateCompetitionStartDate ¶
func (s *FirebaseStorage) UpdateCompetitionStartDate(startDate time.Time) error
type InMemoryStorage ¶
type InMemoryStorage struct {
// contains filtered or unexported fields
}
InMemoryStorage 테스트/개발용 비영구 저장소 구현
func NewInMemoryStorage ¶
func NewInMemoryStorage(apiClient interfaces.APIClient) *InMemoryStorage
NewInMemoryStorage 새 인메모리 저장소 생성
func (*InMemoryStorage) AddParticipant ¶
func (s *InMemoryStorage) AddParticipant(name, baekjoonID string, startTier, startRating int, organizationID int) error
AddParticipant 참가자 추가
func (*InMemoryStorage) CreateCompetition ¶
func (s *InMemoryStorage) CreateCompetition(name string, startDate, endDate time.Time) error
CreateCompetition 새 대회 생성 및 활성화
func (*InMemoryStorage) GetCompetition ¶
func (s *InMemoryStorage) GetCompetition() *models.Competition
GetCompetition 활성 대회 조회
func (*InMemoryStorage) GetParticipants ¶
func (s *InMemoryStorage) GetParticipants() []models.Participant
GetParticipants 참가자 전체 조회
func (*InMemoryStorage) IsBlackoutPeriod ¶
func (s *InMemoryStorage) IsBlackoutPeriod() bool
IsBlackoutPeriod 블랙아웃 기간 여부
func (*InMemoryStorage) RemoveParticipant ¶
func (s *InMemoryStorage) RemoveParticipant(baekjoonID string) error
RemoveParticipant 참가자 제거
func (*InMemoryStorage) SaveCompetition ¶
func (s *InMemoryStorage) SaveCompetition() error
SaveCompetition no-op
func (*InMemoryStorage) SaveParticipants ¶
func (s *InMemoryStorage) SaveParticipants() error
SaveParticipants no-op
func (*InMemoryStorage) SetScoreboardVisibility ¶
func (s *InMemoryStorage) SetScoreboardVisibility(visible bool) error
SetScoreboardVisibility 스코어보드 가시성 설정
func (*InMemoryStorage) UpdateCompetitionEndDate ¶
func (s *InMemoryStorage) UpdateCompetitionEndDate(endDate time.Time) error
UpdateCompetitionEndDate 종료일 변경 및 블랙아웃 재계산
func (*InMemoryStorage) UpdateCompetitionName ¶
func (s *InMemoryStorage) UpdateCompetitionName(name string) error
UpdateCompetitionName 이름 변경
func (*InMemoryStorage) UpdateCompetitionStartDate ¶
func (s *InMemoryStorage) UpdateCompetitionStartDate(startDate time.Time) error
UpdateCompetitionStartDate 시작일 변경