sql

package
v0.0.0-...-e96bf11 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package storage/sql defines storage structures for FantasyFootballApi Copyright (C) 2019-2026 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/sql FantasyFootballApi Copyright (C) 2019-2025 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/sql FantasyFootballApi Copyright (C) 2019-2026 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 sql defines storage structures for FantasyFootballApi Copyright (C) 2019-2025 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 data/sql defines data structures for FantasyFootballApi Copyright (C) 2019-2026 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 data/sql defines data structures for FantasyFootballApi Copyright (C) 2019-2026 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 data/sql defines storage structures for FantasyFootballApi Copyright (C) 2019-2026 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/sql defines storage structures for FantasyFootballApi Copyright (C) 2019-2026 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 data/sql defines storage structures for FantasyFootballApi Copyright (C) 2019-2026 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/sql FantasyFootballApi Copyright (C) 2019-2026 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/sql defines storage structures for FantasyFootballApi Copyright (C) 2019-2026 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/sql FantasyFootballApi Copyright (C) 2019-2026 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/sql FantasyFootballApi Copyright (C) 2019-2025 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/sql defines storage structures for FantasyFootballApi Copyright (C) 2019-2026 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/sql FantasyFootballApi Copyright (C) 2019-2025 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/sql FantasyFootballApi Copyright (C) 2019-2026 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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataLayer

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

DataLayer purpose is to bring and store data This one is based on gorm

func NewDataLayer

func NewDataLayer(storage string, path string) DataLayer

NewDataLayer initialize the DataLayer with storage type string and the path of the storage

func (DataLayer) Close

func (dp DataLayer) Close()

func (*DataLayer) CreateCoach

func (dp *DataLayer) CreateCoach(coach core.Coach) error

CreateCoach stores a coach into storage

func (*DataLayer) CreateEdition

func (dp *DataLayer) CreateEdition(edition core.Edition) error

CreateEdition stores an edition into storage

func (*DataLayer) CreateGame

func (dp *DataLayer) CreateGame(game core.Game) error

CreateGame stores a game into storage

func (*DataLayer) CreateSquad

func (dp *DataLayer) CreateSquad(squad core.Squad) error

CreateSquad stores a squad into storage

func (DataLayer) DeleteCoachWithEditionNameAndName

func (dp DataLayer) DeleteCoachWithEditionNameAndName(editionName string, name string) error

DeleteCoachWithEditionNameAndName delete a coach identified by edition name and name

func (DataLayer) DeleteCoachWithEditionSlugAndSlug

func (dp DataLayer) DeleteCoachWithEditionSlugAndSlug(editionSlug string, slug string) error

DeleteCoachWithEditionSlugAndSlug delete a coach identified by edition slug and slug

func (DataLayer) DeleteEditionWithName

func (dp DataLayer) DeleteEditionWithName(name string) error

DeleteEditionWithName delete an edition identified by name

func (DataLayer) DeleteEditionWithSlug

func (dp DataLayer) DeleteEditionWithSlug(slug string) error

DeleteEditionWithSlug delete an edition identified by name

func (DataLayer) DeleteGameWithEditionNameRoundAndTable

func (dp DataLayer) DeleteGameWithEditionNameRoundAndTable(editionName string, round uint, table uint) error

DeleteGameWithEditionNameRoundAndTable deletes one game identified by edition name, round and table

func (DataLayer) DeleteGameWithEditionSlugRoundAndTable

func (dp DataLayer) DeleteGameWithEditionSlugRoundAndTable(editionSlug string, round uint, table uint) error

DeleteGameWithEditionSlugRoundAndTable deletes one game identified by edition slug, round and table

func (DataLayer) DeleteSquadWithEditionNameAndName

func (dp DataLayer) DeleteSquadWithEditionNameAndName(editionName string, name string) error

DeleteSquadWithEditionNameAndName delete a squad identified by edition name and name

func (DataLayer) DeleteSquadWithEditionSlugAndSlug

func (dp DataLayer) DeleteSquadWithEditionSlugAndSlug(editionSlug string, slug string) error

DeleteSquadWithEditionSlugAndSlug delete a squad identified by edition slug and slug

func (DataLayer) DeprecatedGetCoach

func (dp DataLayer) DeprecatedGetCoach(id uint) (data.DeprecatedCoach, error)

DeprecatedGetCoach returns the DeprecatedCoach identified by id

func (DataLayer) DeprecatedGetCoachsByEdition

func (dp DataLayer) DeprecatedGetCoachsByEdition(idEdition uint) ([]data.DeprecatedCoach, error)

GetCoachsByEdition returns all coachs in an edition

func (DataLayer) DeprecatedGetEdition

func (dp DataLayer) DeprecatedGetEdition(id uint) (data.DeprecatedEdition, error)

DeprecatedGetEdition returns the edition identified by id

func (DataLayer) DeprecatedGetEditions

func (dp DataLayer) DeprecatedGetEditions() ([]data.DeprecatedEdition, error)

func (DataLayer) DeprecatedGetGame

func (dp DataLayer) DeprecatedGetGame(id uint) (data.DeprecatedGame, error)

DeprecatedGetGame returns the game identified by id

func (DataLayer) DeprecatedGetGamesByCoach

func (dp DataLayer) DeprecatedGetGamesByCoach(idCoach uint) ([]data.DeprecatedGame, error)

DeprecatedGetGamesByCoach returns all games played by coach

func (DataLayer) DeprecatedGetGamesByEdition

func (dp DataLayer) DeprecatedGetGamesByEdition(idEdition uint) ([]data.DeprecatedGame, error)

DeprecatedGetGamesByEdition returns all games in an edition

func (DataLayer) DeprecatedGetGamesByEditionAndPlayed

func (dp DataLayer) DeprecatedGetGamesByEditionAndPlayed(idEdition uint, played bool) ([]data.DeprecatedGame, error)

DeprecatedGetGamesByEditionAndPlayed returns all games in an edition with played value

func (DataLayer) DeprecatedGetGamesByEditionAndRound

func (dp DataLayer) DeprecatedGetGamesByEditionAndRound(idEdition uint, round uint) ([]data.DeprecatedGame, error)

DeprecatedGetGamesByEditionAndRound returns all games in an edition, a round

func (DataLayer) DeprecatedGetGamesByEditionRoundAndPlayed

func (dp DataLayer) DeprecatedGetGamesByEditionRoundAndPlayed(idEdition uint, round uint, played bool) ([]data.DeprecatedGame, error)

DeprecatedGetGamesByEditionRoundAndPlayed returns all games in an edition, a round with played value

func (DataLayer) DeprecatedGetGamesBySquad

func (dp DataLayer) DeprecatedGetGamesBySquad(idSquad uint) ([]data.DeprecatedGame, error)

DeprecatedGetGamesBySquad returns all games played by squad members of a given squad

func (DataLayer) DeprecatedGetSquad

func (dp DataLayer) DeprecatedGetSquad(id uint) (data.DeprecatedSquad, error)

DeprecatedGetSquad returns the squad identified by id

func (DataLayer) DeprecatedGetSquadsByEdition

func (dp DataLayer) DeprecatedGetSquadsByEdition(idEdition uint) ([]data.DeprecatedSquad, error)

DeprecatedGetSquadsByEdition returns all squads in an edition

func (DataLayer) GetCoachAndSquadByEditionNameAndCoachName

func (dl DataLayer) GetCoachAndSquadByEditionNameAndCoachName(editionName string, coachName string) (core.Coach, bool, core.Squad, error)

Get Coach and associated Squad by edition name and coach name

func (DataLayer) GetCoachAndSquadByEditionSlugAndCoachSlug

func (dl DataLayer) GetCoachAndSquadByEditionSlugAndCoachSlug(editionSlug string, coachSlug string) (core.Coach, bool, core.Squad, error)

Get Coach and associated Squad by edition slug and coach slug

func (DataLayer) GetCoachByEditionNameAndName

func (dp DataLayer) GetCoachByEditionNameAndName(editionName string, name string) (core.Coach, error)

GetCoachByEditionNameAndName returns the Coach identified by edition name and name

func (DataLayer) GetCoachByEditionSlugAndSlug

func (dp DataLayer) GetCoachByEditionSlugAndSlug(editionSlug string, slug string) (core.Coach, error)

func (DataLayer) GetCoachsByEditionName

func (dp DataLayer) GetCoachsByEditionName(editionName string) ([]core.Coach, error)

GetCoachsByEditionName returns all coachs in an edition selected by name of the edition

func (DataLayer) GetCoachsByEditionSlug

func (dp DataLayer) GetCoachsByEditionSlug(editionSlug string) ([]core.Coach, error)

GetCoachsByEditionSlug returns all coachs in an edition

func (DataLayer) GetEditionByName

func (dp DataLayer) GetEditionByName(name string) (core.Edition, error)

GetEditionByName returns the edition identified by name

func (DataLayer) GetEditionBySlug

func (dp DataLayer) GetEditionBySlug(slug string) (core.Edition, error)

GetEditionBySlug returns the edition identified by slug

func (DataLayer) GetEditions

func (dp DataLayer) GetEditions() ([]core.Edition, error)

GetEditions returns all editions

func (DataLayer) GetGameByEditionNameRoundAndTable

func (dp DataLayer) GetGameByEditionNameRoundAndTable(editionName string, round uint, table uint) (core.Game, error)

func (DataLayer) GetGameByEditionSlugRoundAndTable

func (dp DataLayer) GetGameByEditionSlugRoundAndTable(editionSlug string, round uint, table uint) (core.Game, error)

func (DataLayer) GetGamesByEditionName

func (dp DataLayer) GetGamesByEditionName(editionName string) ([]core.Game, error)

GetGamesByEditionName returns all games in an edition

func (DataLayer) GetGamesByEditionNameAndPlayed

func (dp DataLayer) GetGamesByEditionNameAndPlayed(editionName string, played bool) ([]core.Game, error)

func (DataLayer) GetGamesByEditionNameAndRound

func (dp DataLayer) GetGamesByEditionNameAndRound(editionName string, round uint) ([]core.Game, error)

func (DataLayer) GetGamesByEditionNameRoundAndPlayed

func (dp DataLayer) GetGamesByEditionNameRoundAndPlayed(editionName string, round uint, played bool) ([]core.Game, error)

func (DataLayer) GetGamesByEditionSlug

func (dp DataLayer) GetGamesByEditionSlug(editionSlug string) ([]core.Game, error)

GetGamesByEditionName returns all games in an edition

func (DataLayer) GetGamesByEditionSlugAndCoachSlug

func (dp DataLayer) GetGamesByEditionSlugAndCoachSlug(editionSlug string, coachSlug string) ([]core.Game, error)

func (DataLayer) GetGamesByEditionSlugAndPlayed

func (dp DataLayer) GetGamesByEditionSlugAndPlayed(editionSlug string, played bool) ([]core.Game, error)

func (DataLayer) GetGamesByEditionSlugAndRound

func (dp DataLayer) GetGamesByEditionSlugAndRound(editionSlug string, round uint) ([]core.Game, error)

func (DataLayer) GetGamesByEditionSlugAndSquadSlug

func (dp DataLayer) GetGamesByEditionSlugAndSquadSlug(editionSlug string, squadSlug string) ([]core.Game, error)

func (DataLayer) GetGamesByEditionSlugRoundAndPlayed

func (dp DataLayer) GetGamesByEditionSlugRoundAndPlayed(editionSlug string, round uint, played bool) ([]core.Game, error)

func (DataLayer) GetLastInsertedId

func (dp DataLayer) GetLastInsertedId() uint

func (DataLayer) GetSquadByEditionNameAndName

func (dp DataLayer) GetSquadByEditionNameAndName(editionName string, name string) (core.Squad, error)

GetSquadByEditionNameAndName returns the squad identified by edition name and name

func (DataLayer) GetSquadByEditionSlugAndSlug

func (dp DataLayer) GetSquadByEditionSlugAndSlug(editionSlug, slug string) (core.Squad, error)

GetSquadByEditionSlugAndSlug returns one squad identified by edition slug and squad slug

func (DataLayer) GetSquadsByEditionName

func (dp DataLayer) GetSquadsByEditionName(editionName string) ([]core.Squad, error)

GetSquadsByEditionName returns all squads in an edition

func (DataLayer) GetSquadsByEditionSlug

func (dp DataLayer) GetSquadsByEditionSlug(editionSlug string) ([]core.Squad, error)

GetSquadsByEditionName returns all squads in an edition

func (DataLayer) UpdateCoachReadinessWithEditionNameAndName

func (dp DataLayer) UpdateCoachReadinessWithEditionNameAndName(editionName string, name string, readiness bool) error

UpdateCoachReadinessWithEditionNameAndName updates the readiness state of one coach identified with name and edition name

func (DataLayer) UpdateCoachReadinessWithEditionSlugAndSlug

func (dp DataLayer) UpdateCoachReadinessWithEditionSlugAndSlug(editionSlug string, slug string, readiness bool) error

UpdateCoachReadinessWithEditionSlugAndSlug updates the readiness state of one coach identified with slug and edition slug

func (DataLayer) UpdateCoachWithPreviousNames

func (dp DataLayer) UpdateCoachWithPreviousNames(coach core.Coach, previousEditionName, previousName string) error

UpdateCoachWithPreviousNames updates a coach and only a coach identified with previous edition name and previous name

func (DataLayer) UpdateCoachWithPreviousSlugs

func (dp DataLayer) UpdateCoachWithPreviousSlugs(coach core.Coach, previousEditionSlug, previousSlug string) error

UpdateCoachWithPreviousSlugs updates a coach and only a coach identified with previous edition slug and previous slug

func (DataLayer) UpdateEditionWithPreviousName

func (dp DataLayer) UpdateEditionWithPreviousName(edition core.Edition, previousName string) error

UpdateEditionWithPreviousName updates an edition

func (DataLayer) UpdateEditionWithPreviousSlug

func (dp DataLayer) UpdateEditionWithPreviousSlug(edition core.Edition, previousSlug string) error

UpdateEditionWithPreviousSlug updates an edition with his previous slug

func (DataLayer) UpdateGameWithPreviousEditionNameRoundAndTable

func (dp DataLayer) UpdateGameWithPreviousEditionNameRoundAndTable(game core.Game, previousEditionName string, previousRound, previousTable uint) error

UpdateGameWithPreviousEditionNameRoundAndTable updates one game and only one game identified by previousEditionName, previousRound and previousTable

func (DataLayer) UpdateGameWithPreviousEditionSlugRoundAndTable

func (dp DataLayer) UpdateGameWithPreviousEditionSlugRoundAndTable(game core.Game, previousEditionName string, previousRound, previousTable uint) error

UpdateGameWithPreviousEditionSlugRoundAndTable updates one game and only one game identified by previous edition slug, previous round and previous table

func (DataLayer) UpdateSquadReadinessWithEditionNameAndName

func (dp DataLayer) UpdateSquadReadinessWithEditionNameAndName(editionName, name string, readiness bool) error

UpdateSquadReadinessWithEditionNameAndName updates the readiness state of all coachs of one squad identified with edition name and name

func (DataLayer) UpdateSquadReadinessWithEditionSlugAndSlug

func (dp DataLayer) UpdateSquadReadinessWithEditionSlugAndSlug(editionSlug string, slug string, readiness bool) error

UpdateSquadReadinessWithEditionSlugAndSlug updates the readiness state of all coachs of one squad identified with edition slug and slug

func (DataLayer) UpdateSquadWithPreviousNames

func (dp DataLayer) UpdateSquadWithPreviousNames(squad core.Squad, previousEditionName, previousName string) error

UpdateSquadWithPreviousNames updates a squad and only a squad

func (DataLayer) UpdateSquadWithPreviousSlugs

func (dp DataLayer) UpdateSquadWithPreviousSlugs(squad core.Squad, previousEditionSlug, previousSlug string) error

UpdateSquadWithPreviousNames updates a squad and only a squad

Jump to

Keyboard shortcuts

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