forum

package
v0.0.0-...-ba06689 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMainContentFromForumHtml

func GetMainContentFromForumHtml(body []byte) string

func GetMainTitleFromForumHtml

func GetMainTitleFromForumHtml(body []byte) string

func NewNullInt64

func NewNullInt64(i *int64) sql.NullInt64

Types

type BeginState

type BeginState struct {
}

func (*BeginState) ProcessLine

func (s *BeginState) ProcessLine(fr *ForumResults, line string) FAState

type Dancer

type Dancer struct {
	Id           int64
	Title        string
	ClassClassic string
	ClassJnj     string
	Clubs        []string
}

type DbInserter

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

func NewDbInserter

func NewDbInserter(dao InsertDao) *DbInserter

func (*DbInserter) Insert

func (in *DbInserter) Insert(results *ForumResults)

type FAState

type FAState interface {
	ProcessLine(fr *ForumResults, line string) FAState
}

type FinalTechResult

type FinalTechResult struct {
	Value string
}

type ForumDao

type ForumDao interface {
	FindJudgeIdByTitle(title string) int64
	FindCompetitionId(compUrl string) int64
}

func NewDao

func NewDao(db *runner.DB) ForumDao

type ForumDaoImpl

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

func (*ForumDaoImpl) FindCompetitionId

func (f *ForumDaoImpl) FindCompetitionId(compUrl string) int64

func (*ForumDaoImpl) FindJudgeIdByTitle

func (f *ForumDaoImpl) FindJudgeIdByTitle(title string) int64

type ForumDbFiller

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

func NewForumDbFiller

func NewForumDbFiller(compUrl string, dao ForumDao) *ForumDbFiller

func (*ForumDbFiller) FillDbInfo

func (f *ForumDbFiller) FillDbInfo(fr *ForumResults)

type ForumResults

type ForumResults struct {
	JudgesResults []*JudgeTeam
	Date          time.Time
	Title         string
	Remaining     string

	CompetitionId int64
}

func ParseForum

func ParseForum(data []byte, mainTitle string) *ForumResults

type InsertDao

type InsertDao interface {
	CreatePartition(index int, compId int64) int64
	DeletePartitionsByCompId(compId int64)
	DeleteJudgesByCompId(compId int64)
	DeletePlacesByCompId(compId int64)
	DeleteNominationsByCompId(compId int64)
	DeleteDancerClubsByCompId(compId int64)
	CreateJudge(j *Judge) *Judge
	CreateNomination(n *Nomination) *Nomination
	CreatePlace(p *Place) *Place
	FindDancer(compId int64, dTitle string) *int64
	FindResult(compId int64, dancerId int64, isJnj bool) *parser.RawCompetitionResult
	FindResultNom(compId, nomId, dancerId int64) *int64

	FindClubByName(clubName string) *int64
	InsertDancerClub(compId, dancerId, clubId int64)
}

func NewInsertDao

func NewInsertDao(db *runner.DB) InsertDao

type InsertDaoImpl

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

func (*InsertDaoImpl) CreateJudge

func (d *InsertDaoImpl) CreateJudge(judge *Judge) *Judge

func (*InsertDaoImpl) CreateNomination

func (d *InsertDaoImpl) CreateNomination(nomination *Nomination) *Nomination

func (*InsertDaoImpl) CreatePartition

func (d *InsertDaoImpl) CreatePartition(index int, compId int64) int64

func (*InsertDaoImpl) CreatePlace

func (d *InsertDaoImpl) CreatePlace(p *Place) *Place

func (*InsertDaoImpl) DeleteDancerClubsByCompId

func (d *InsertDaoImpl) DeleteDancerClubsByCompId(compId int64)

func (*InsertDaoImpl) DeleteJudgesByCompId

func (d *InsertDaoImpl) DeleteJudgesByCompId(compId int64)

func (*InsertDaoImpl) DeleteNominationsByCompId

func (d *InsertDaoImpl) DeleteNominationsByCompId(compId int64)

func (*InsertDaoImpl) DeletePartitionsByCompId

func (d *InsertDaoImpl) DeletePartitionsByCompId(compId int64)

func (*InsertDaoImpl) DeletePlacesByCompId

func (d *InsertDaoImpl) DeletePlacesByCompId(compId int64)

func (*InsertDaoImpl) FindClubByName

func (d *InsertDaoImpl) FindClubByName(clubName string) *int64

func (*InsertDaoImpl) FindDancer

func (d *InsertDaoImpl) FindDancer(compId int64, dTitle string) *int64

func (*InsertDaoImpl) FindResult

func (d *InsertDaoImpl) FindResult(compId int64, dancerId int64, isJnj bool) *parser.RawCompetitionResult

func (*InsertDaoImpl) FindResultNom

func (d *InsertDaoImpl) FindResultNom(compId, nomId, dancerId int64) *int64

func (*InsertDaoImpl) InsertDancerClub

func (d *InsertDaoImpl) InsertDancerClub(compId, dancerId, clubId int64)

type Judge

type Judge struct {
	ID       int64  `db:"id"`
	DancerId int64  `db:"dancer_id"`
	Letter   string `db:"letter"`
	Title    string

	PartitionId int64 `db:"partition_id"`
}

type JudgeTeam

type JudgeTeam struct {
	Judges      []*Judge
	Nominations []*Nomination
}

type JudgeTeamState

type JudgeTeamState struct {
}

func (*JudgeTeamState) ProcessLine

func (s *JudgeTeamState) ProcessLine(fr *ForumResults, line string) FAState

type Nomination

type Nomination struct {
	ID              int64  `db:"id"`
	Title           string `db:"title"`
	Count           int
	Stages          []*Stage
	TechStages      []*TechStage
	FinalTechStage  string
	FinalTechResult []*FinalTechResult

	PartitionId   int64         `db:"partition_id"`
	RNominationId sql.NullInt64 `db:"r_nomination_id"`
}

type Place

type Place struct {
	ID        int64 `db:"id"`
	PlaceFrom int   `db:"place_from"`
	PlaceTo   int   `db:"place_to"`
	Number    int   `db:"number"`
	Dancer1   *Dancer
	Dancer2   *Dancer

	StageTitle   string        `db:"stage_title"`
	NominationId int64         `db:"nomination_id"`
	Dancer1Id    int64         `db:"dancer1_id"`
	Dancer2Id    sql.NullInt64 `db:"dancer2_id"`

	Result1Id sql.NullInt64 `db:"result1_id"`
	Result2Id sql.NullInt64 `db:"result2_id"`
}

type PlacesState

type PlacesState struct {
}

func (*PlacesState) ProcessLine

func (s *PlacesState) ProcessLine(fr *ForumResults, line string) FAState

type Stage

type Stage struct {
	Title  string
	Places []*Place
}

type TechResult

type TechResult struct {
	Value string
}

type TechStage

type TechStage struct {
	Title   string
	Results []*TechResult
}

type TechnicalFinalState

type TechnicalFinalState struct {
}

func (*TechnicalFinalState) ProcessLine

func (s *TechnicalFinalState) ProcessLine(fr *ForumResults, line string) FAState

type TechnicalPrepFinalState

type TechnicalPrepFinalState struct {
}

func (*TechnicalPrepFinalState) ProcessLine

func (s *TechnicalPrepFinalState) ProcessLine(fr *ForumResults, line string) FAState

type TechnicalState

type TechnicalState struct {
}

func (*TechnicalState) ProcessLine

func (s *TechnicalState) ProcessLine(fr *ForumResults, line string) FAState

Jump to

Keyboard shortcuts

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