Documentation ¶
Overview ¶
Package storage defines storage structures for FantasyFootballApi Copyright (C) 2019-2023 Bertrand Madet Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package storage FantasyFootballApi Copyright (C) 2019-2023 Bertrand Madet Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package storage FantasyFootballApi Copyright (C) 2019-2023 Bertrand Madet Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package storage defines storage structures for FantasyFootballApi Copyright (C) 2019-2023 Bertrand Madet Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package storage defines storage structures for FantasyFootballApi Copyright (C) 2019-2023 Bertrand Madet Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package storage FantasyFootballApi Copyright (C) 2019-2023 Bertrand Madet Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package storage defines storage structures for FantasyFootballApi Copyright (C) 2019-2023 Bertrand Madet Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package storage FantasyFootballApi Copyright (C) 2019-2023 Bertrand Madet Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package storage FantasyFootballApi Copyright (C) 2019-2024 Bertrand Madet Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package storage defines storage structures for FantasyFootballApi Copyright (C) 2019-2023 Bertrand Madet Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package storage FantasyFootballApi Copyright (C) 2019-2023 Bertrand Madet Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package storage FantasyFootballApi Copyright (C) 2019-2023 Bertrand Madet Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type DataProvider
- func (dp DataProvider) CreateCoach(coach core.Coach) (uint, error)
- func (dp DataProvider) CreateEdition(edition core.Edition) (uint, error)
- func (dp DataProvider) CreateGame(game core.Game) (uint, error)
- func (dp DataProvider) CreateSquad(squad core.Squad) (uint, error)
- func (dp DataProvider) DeleteCoach(id uint) error
- func (dp DataProvider) DeleteEdition(id uint) error
- func (dp DataProvider) DeleteGame(id uint) error
- func (dp DataProvider) DeleteSquad(id uint) error
- func (dp DataProvider) GetCoach(id uint) (core.Coach, error)
- func (dp DataProvider) GetCoachsByEdition(idEdition uint) ([]core.Coach, error)
- func (dp DataProvider) GetEdition(id uint) (core.Edition, error)
- func (dp DataProvider) GetEditions() ([]core.Edition, error)
- func (dp DataProvider) GetGame(id uint) (core.Game, error)
- func (dp DataProvider) GetGamesByCoach(idCoach uint) ([]core.Game, error)
- func (dp DataProvider) GetGamesByEdition(idEdition uint) ([]core.Game, error)
- func (dp DataProvider) GetGamesByEditionAndPlayed(idEdition uint, played bool) ([]core.Game, error)
- func (dp DataProvider) GetGamesByEditionAndRound(idEdition uint, round uint) ([]core.Game, error)
- func (dp DataProvider) GetGamesByEditionRoundAndPlayed(idEdition uint, round uint, played bool) ([]core.Game, error)
- func (dp DataProvider) GetGamesBySquad(idSquad uint) ([]core.Game, error)
- func (dp DataProvider) GetSquad(id uint) (core.Squad, error)
- func (dp DataProvider) GetSquadsByEdition(idEdition uint) ([]core.Squad, error)
- func (dp DataProvider) UpdateCoach(coach core.Coach) error
- func (dp DataProvider) UpdateEdition(edition core.Edition) error
- func (dp DataProvider) UpdateGame(game core.Game) error
- func (dp DataProvider) UpdateSquad(squad core.Squad) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataProvider ¶
type DataProvider struct {
// contains filtered or unexported fields
}
DataProvider purpose is to bring data
func InitDataProvider ¶
func InitDataProvider(storage string, path string) *DataProvider
InitDataProvider initialize the DataProvider with storage type string and the path of the storage
func (DataProvider) CreateCoach ¶
func (dp DataProvider) CreateCoach(coach core.Coach) (uint, error)
CreateCoach stores a coach into storage
func (DataProvider) CreateEdition ¶
func (dp DataProvider) CreateEdition(edition core.Edition) (uint, error)
CreateEdition stores an edition into storage
func (DataProvider) CreateGame ¶
func (dp DataProvider) CreateGame(game core.Game) (uint, error)
CreateGame stores a game into storage
func (DataProvider) CreateSquad ¶
func (dp DataProvider) CreateSquad(squad core.Squad) (uint, error)
CreateSquad stores a squad into storage
func (DataProvider) DeleteCoach ¶
func (dp DataProvider) DeleteCoach(id uint) error
DeleteCoach delete a coach identified by id
func (DataProvider) DeleteEdition ¶
func (dp DataProvider) DeleteEdition(id uint) error
DeleteEdition delete an edition identified by id
func (DataProvider) DeleteGame ¶
func (dp DataProvider) DeleteGame(id uint) error
DeleteGame delete a game identified by id
func (DataProvider) DeleteSquad ¶
func (dp DataProvider) DeleteSquad(id uint) error
DeleteSquad delete a squad identified by id
func (DataProvider) GetCoach ¶
func (dp DataProvider) GetCoach(id uint) (core.Coach, error)
GetCoach returns the Coach identified by id
func (DataProvider) GetCoachsByEdition ¶
func (dp DataProvider) GetCoachsByEdition(idEdition uint) ([]core.Coach, error)
GetCoachsByEdition returns all coachs in an edition
func (DataProvider) GetEdition ¶
func (dp DataProvider) GetEdition(id uint) (core.Edition, error)
GetEdition returns the edition identified by id
func (DataProvider) GetEditions ¶
func (dp DataProvider) GetEditions() ([]core.Edition, error)
GetEditions returns all editions
func (DataProvider) GetGame ¶
func (dp DataProvider) GetGame(id uint) (core.Game, error)
GetGame returns the game identified by id
func (DataProvider) GetGamesByCoach ¶
func (dp DataProvider) GetGamesByCoach(idCoach uint) ([]core.Game, error)
GetGamesByCoach returns all games played by coach
func (DataProvider) GetGamesByEdition ¶
func (dp DataProvider) GetGamesByEdition(idEdition uint) ([]core.Game, error)
GetGamesByEdition returns all games in an edition
func (DataProvider) GetGamesByEditionAndPlayed ¶
GetGamesByEditionAndPlayed returns all games in an edition with played value
func (DataProvider) GetGamesByEditionAndRound ¶
GetGamesByEditionAndRound returns all games in an edition, a round
func (DataProvider) GetGamesByEditionRoundAndPlayed ¶
func (dp DataProvider) GetGamesByEditionRoundAndPlayed(idEdition uint, round uint, played bool) ([]core.Game, error)
GetGamesByEditionRoundAndPlayed returns all games in an edition, a round with played value
func (DataProvider) GetGamesBySquad ¶
func (dp DataProvider) GetGamesBySquad(idSquad uint) ([]core.Game, error)
GetGamesBySquad returns all games played by squad members of a given squad
func (DataProvider) GetSquad ¶
func (dp DataProvider) GetSquad(id uint) (core.Squad, error)
GetSquad returns the squad identified by id
func (DataProvider) GetSquadsByEdition ¶
func (dp DataProvider) GetSquadsByEdition(idEdition uint) ([]core.Squad, error)
GetSquadsByEdition returns all squads in an edition
func (DataProvider) UpdateCoach ¶
func (dp DataProvider) UpdateCoach(coach core.Coach) error
UpdateCoach updates a coach and only a coach
func (DataProvider) UpdateEdition ¶
func (dp DataProvider) UpdateEdition(edition core.Edition) error
UpdateEdition updates an edition
func (DataProvider) UpdateGame ¶
func (dp DataProvider) UpdateGame(game core.Game) error
UpdateGame updates a game and only a game
func (DataProvider) UpdateSquad ¶
func (dp DataProvider) UpdateSquad(squad core.Squad) error
UpdateSquad updates a squad and only a squad